瀏覽代碼

Merge pull request #158 from camaya/redact-only-secret-on-line

Change redacted behaviour on the line information
Zachary Rice 7 年之前
父節點
當前提交
b902d7310a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      main.go

+ 1 - 1
main.go

@@ -669,7 +669,7 @@ func addLeak(leaks []Leak, line string, offender string, leakType string, diff g
 	}
 	}
 	if opts.Redact {
 	if opts.Redact {
 		leak.Offender = "REDACTED"
 		leak.Offender = "REDACTED"
-		leak.Line = "REDACTED"
+		leak.Line = strings.Replace(line, offender, "REDACTED", -1)
 	}
 	}
 
 
 	if opts.Verbose {
 	if opts.Verbose {