From d55222238581a30d4bd0cd072abcda09aa75dfab Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Tue, 28 Nov 2023 09:45:37 -0600 Subject: [PATCH] add extradata nil check and use make (#2129) * add extradata nil check and use make * remove some lines --- pkg/detectors/awssessionkeys/awssessionkey.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/detectors/awssessionkeys/awssessionkey.go b/pkg/detectors/awssessionkeys/awssessionkey.go index 3b53aa27..aee31402 100644 --- a/pkg/detectors/awssessionkeys/awssessionkey.go +++ b/pkg/detectors/awssessionkeys/awssessionkey.go @@ -130,13 +130,15 @@ func (s scanner) FromData(ctx context.Context, verify bool, data []byte) (result Raw: []byte(resIDMatch), Redacted: resIDMatch, RawV2: []byte(resIDMatch + resSecretMatch + resSessionMatch), - ExtraData: map[string]string{}, + ExtraData: make(map[string]string), } if verify { verified, extraData, verificationErr := s.verifyMatch(ctx, resIDMatch, resSecretMatch, resSessionMatch, true) s1.Verified = verified - s1.ExtraData = extraData + if extraData != nil { + s1.ExtraData = extraData + } s1.VerificationError = verificationErr }