From 1c14586cde267d193f27468ea874bd6fa5b5ed61 Mon Sep 17 00:00:00 2001 From: zach rice Date: Tue, 26 Mar 2019 16:06:43 -0500 Subject: [PATCH] main.go, need to work on tests next --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 7ce8428c..eb3a0731 100644 --- a/main.go +++ b/main.go @@ -67,6 +67,7 @@ const leakExit = 1 var ( opts *Options + config *Config singleSearchRegex *regexp.Regexp dir string threads int @@ -74,7 +75,6 @@ var ( commitMap = make(map[string]bool) cMutex = &sync.Mutex{} auditDone bool - config *Config ) func init() { @@ -132,7 +132,6 @@ func run() ([]Leak, error) { return nil, err } } - fmt.Println(opts) // start audits if opts.Repo != "" || opts.RepoPath != "" { @@ -176,11 +175,12 @@ func run() ([]Leak, error) { // writeReport writes a report to a file specified in the --report= option. // Default format for report is JSON. You can use the --csv option to write the report as a csv func writeReport(leaks []Leak) error { + var err error + if len(leaks) == 0 { return nil } - var err error log.Infof("writing report to %s", opts.Report) if strings.HasSuffix(opts.Report, ".csv") { f, err := os.Create(opts.Report)