From 06f2ea4cf02ae1ff94c67d9283bdff8c607e13c0 Mon Sep 17 00:00:00 2001 From: Ahrav Dutta Date: Sun, 29 Sep 2024 11:12:30 -0700 Subject: [PATCH] use old version --- pkg/detectors/privatekey/privatekey.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/detectors/privatekey/privatekey.go b/pkg/detectors/privatekey/privatekey.go index 4a477bbe24ea..32bd3f9fd8f7 100644 --- a/pkg/detectors/privatekey/privatekey.go +++ b/pkg/detectors/privatekey/privatekey.go @@ -85,14 +85,14 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result } if verify { - var wg sync.WaitGroup - - extraData := newExtraData() - verificationErrors := newVerificationErrors() - - wg.Add(3) + var ( + wg sync.WaitGroup + extraData = newExtraData() + verificationErrors = newVerificationErrors() + ) // Look up certificate information. + wg.Add(1) go func() { defer wg.Done() data, err := lookupFingerprint(ctx, fingerprint, s.IncludeExpired) @@ -104,6 +104,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result }() // Test SSH key against GitHub. + wg.Add(1) go func() { defer wg.Done() user, err := verifyGitHubUser(ctx, parsedKey) @@ -116,6 +117,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result }() // Test SSH key against GitLab. + wg.Add(1) go func() { defer wg.Done() user, err := verifyGitLabUser(ctx, parsedKey)