From 25736d115fcd0c66fda47257ecb185bf951c0124 Mon Sep 17 00:00:00 2001 From: zricethezav Date: Wed, 28 Feb 2018 23:25:04 -0600 Subject: [PATCH] some barebones tests --- checks_test.go | 4 ++-- options.go | 2 +- repo.go | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/checks_test.go b/checks_test.go index 89a377de..56cb8cdf 100644 --- a/checks_test.go +++ b/checks_test.go @@ -6,7 +6,7 @@ import ( func TestCheckRegex(t *testing.T) { var results []Leak - opts := &Options{ + opts = &Options{ Concurrency: 10, B64EntropyCutoff: 70, HexEntropyCutoff: 40, @@ -22,7 +22,7 @@ func TestCheckRegex(t *testing.T) { } for k, v := range checks { - results = doChecks(k, commit, opts, repo) + results = doChecks(k, commit, &repo) if v != len(results) { t.Errorf("regexCheck failed on string %s", k) } diff --git a/options.go b/options.go index b9d03be2..9063c79d 100644 --- a/options.go +++ b/options.go @@ -317,6 +317,6 @@ func (opts *Options) setupLogger() { // isGithubTarget checks if url is a valid github target func isGithubTarget(url string) bool { - re := regexp.MustCompile("github\\.com\\/") + re := regexp.MustCompile("github.com") return re.MatchString(url) } diff --git a/repo.go b/repo.go index 6235adc6..f378d2dc 100644 --- a/repo.go +++ b/repo.go @@ -228,7 +228,6 @@ func reportAggregator(gitLeakReceiverWG *sync.WaitGroup, gitLeaks chan Leak, lea } fmt.Println(string(b)) } - gitLeakReceiverWG.Done() } }