Show log on log.Fatal calls, provide "sanitized" version, fix goreleaser

Sanitization means change anything in double quotes to "CENSORED". A
notice is included telling the user to check for themselves as well.
This commit is contained in:
Harvey Tindall
2021-06-11 23:14:16 +01:00
parent f0f4e8118e
commit b538922c05
13 changed files with 2015 additions and 64 deletions
+8
View File
@@ -67,3 +67,11 @@ func (c colorStripper) Write(p []byte) (n int, err error) {
n = len(p)
return
}
func sanitizeLog(l string) string {
quoteCensor, err := regexp.Compile("\"([^\"]*)\"")
if err != nil {
log.Fatalf("Failed to compile sanitizing regexp: %v", err)
}
return string(quoteCensor.ReplaceAll([]byte(l), []byte("\"CENSORED\"")))
}