handle goimports/go vet warnings

This commit is contained in:
Zach Rice committed 2022-03-12 10:44:51 -06:00
1 parent 57d2d345b6
commit 8b70e7fc2f
12 files changed
+178 -127

No files matched your search

-8
View File
@@ -1,7 +1,6 @@
package report
import (
"strconv"
"strings"
)
@@ -43,10 +42,3 @@ func (f *Finding) Redact() {
f.Match = strings.Replace(f.Match, f.Secret, "REDACTED", -1)
f.Secret = "REDACT"
}
func (f *Finding) Hash() string {
return f.Secret + f.Commit +
strconv.Itoa(f.EndLine) +
strconv.Itoa(f.StartLine)
}
+4 -5
View File
@@ -21,13 +21,12 @@ func Write(findings []Finding, cfg config.Config, ext string, reportPath string)
ext = strings.ToLower(ext)
switch ext {
case ".json", "json":
writeJson(findings, file)
err = writeJson(findings, file)
case ".csv", "csv":
writeCsv(findings, file)
err = writeCsv(findings, file)
case ".sarif", "sarif":
writeSarif(cfg, findings, file)
err = writeSarif(cfg, findings, file)
}
return nil
return err
}
+5 -1
View File
@@ -63,7 +63,11 @@ func TestWriteSarif(t *testing.T) {
}
var vc config.ViperConfig
viper.Unmarshal(&vc)
err = viper.Unmarshal(&vc)
if err != nil {
t.Error(err)
}
cfg, err := vc.Translate()
if err != nil {
t.Error(err)