Skip to content

Find, verify, and analyze leaked credentials

[chore] Address more linter errors (#1134)

Miccah6209a80ce160
diff --git a/pkg/detectors/abbysale/abbysale.go b/pkg/detectors/abbysale/abbysale.go
index a3f0d38e8..f71dfd76b 100644
--- a/pkg/detectors/abbysale/abbysale.go
+++ b/pkg/detectors/abbysale/abbysale.go
@@ -2,7 +2,6 @@ package abbysale
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/bitfinex/bitfinex.go b/pkg/detectors/bitfinex/bitfinex.go
index ecf6cd3a6..c53c9f07e 100644
--- a/pkg/detectors/bitfinex/bitfinex.go
+++ b/pkg/detectors/bitfinex/bitfinex.go
@@ -86,7 +86,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1.Verified = isValid
// If there is a valid one, we need to stop iterating now and return the valid result
- if isValid == true {
+ if isValid {
break
}
}
diff --git a/pkg/detectors/brandfetch/brandfetch.go b/pkg/detectors/brandfetch/brandfetch.go
index c2e8f219e..606e7153c 100644
--- a/pkg/detectors/brandfetch/brandfetch.go
+++ b/pkg/detectors/brandfetch/brandfetch.go
@@ -2,7 +2,6 @@ package brandfetch
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -56,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("Content-Type", "application/json")
- req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/clockify/clockify.go b/pkg/detectors/clockify/clockify.go
index 850cffbb6..bb7d21584 100644
--- a/pkg/detectors/clockify/clockify.go
+++ b/pkg/detectors/clockify/clockify.go
@@ -2,7 +2,6 @@ package clockify
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -53,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("content-type", "application/json")
- req.Header.Add("X-Api-Key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-Api-Key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/cloudflarecakey/cloudflarecakey.go b/pkg/detectors/cloudflarecakey/cloudflarecakey.go
index 62963024e..f2d7783fd 100644
--- a/pkg/detectors/cloudflarecakey/cloudflarecakey.go
+++ b/pkg/detectors/cloudflarecakey/cloudflarecakey.go
@@ -66,7 +66,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if res.StatusCode >= 200 && res.StatusCode < 300 {
s1.Verified = true
}
- } else {
}
}
diff --git a/pkg/detectors/everhour/everhour.go b/pkg/detectors/everhour/everhour.go
index 7431b520a..8d7876bad 100644
--- a/pkg/detectors/everhour/everhour.go
+++ b/pkg/detectors/everhour/everhour.go
@@ -2,7 +2,6 @@ package everhour
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -53,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("Content-Type", "application/json")
- req.Header.Add("X-Api-Key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-Api-Key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go
index 68cfd10ac..9a2416a06 100644
--- a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go
+++ b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("Fastly-Key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("Fastly-Key", resMatch)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := io.ReadAll(res.Body)
diff --git a/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go b/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go
index 0600108f7..ed9a605e0 100644
--- a/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go
+++ b/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go
@@ -2,7 +2,6 @@ package figmapersonalaccesstoken
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -51,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("X-Figma-Token", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-Figma-Token", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/fulcrum/fulcrum.go b/pkg/detectors/fulcrum/fulcrum.go
index 725958a03..eae2e4463 100644
--- a/pkg/detectors/fulcrum/fulcrum.go
+++ b/pkg/detectors/fulcrum/fulcrum.go
@@ -2,7 +2,6 @@ package fulcrum
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -53,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("Accept", "application/json")
- req.Header.Add("X-ApiToken", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-ApiToken", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/generic/generic.go b/pkg/detectors/generic/generic.go
index 3bae29549..0e32fe5d0 100644
--- a/pkg/detectors/generic/generic.go
+++ b/pkg/detectors/generic/generic.go
@@ -44,8 +44,7 @@ func New() Scanner {
}
type Scanner struct {
- programmingBookWords []string
- excludeMatchers []*regexp.Regexp
+ excludeMatchers []*regexp.Regexp
}
// Ensure the Scanner satisfies the interface at compile time.
diff --git a/pkg/detectors/impala/impala.go b/pkg/detectors/impala/impala.go
index aa1cd9ed3..e7dceeace 100644
--- a/pkg/detectors/impala/impala.go
+++ b/pkg/detectors/impala/impala.go
@@ -2,7 +2,6 @@ package impala
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/interseller/interseller.go b/pkg/detectors/interseller/interseller.go
index 7f89cbab9..a9b44baa0 100644
--- a/pkg/detectors/interseller/interseller.go
+++ b/pkg/detectors/interseller/interseller.go
@@ -56,11 +56,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
defer res.Body.Close()
if res.StatusCode >= 200 && res.StatusCode < 300 {
s1.Verified = true
- } else {
- // This function will check false positives for common test words, but also it will make sure the key appears 'random' enough to be a real key
- // if detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {
- // continue
- // }
}
}
}
diff --git a/pkg/detectors/keenio/keenio.go b/pkg/detectors/keenio/keenio.go
index 298c15b9e..0637cb692 100644
--- a/pkg/detectors/keenio/keenio.go
+++ b/pkg/detectors/keenio/keenio.go
@@ -2,7 +2,6 @@ package keenio
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -61,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("Content-Type", "application/json")
- req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go b/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
index c48dc0641..456afd7d8 100644
--- a/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
+++ b/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
@@ -2,7 +2,6 @@ package newrelicpersonalapikey
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("X-Api-Key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-Api-Key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/newscatcher/newscatcher.go b/pkg/detectors/newscatcher/newscatcher.go
index 83c5da456..bfd1bca4f 100644
--- a/pkg/detectors/newscatcher/newscatcher.go
+++ b/pkg/detectors/newscatcher/newscatcher.go
@@ -2,7 +2,6 @@ package newscatcher
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/nftport/nftport.go b/pkg/detectors/nftport/nftport.go
index f7e169c5e..6bc019268 100644
--- a/pkg/detectors/nftport/nftport.go
+++ b/pkg/detectors/nftport/nftport.go
@@ -2,7 +2,6 @@ package nftport
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -53,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("Content-Type", "application/json")
- req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/omnisend/omnisend.go b/pkg/detectors/omnisend/omnisend.go
index edce81602..7bd2dcf80 100644
--- a/pkg/detectors/omnisend/omnisend.go
+++ b/pkg/detectors/omnisend/omnisend.go
@@ -2,7 +2,6 @@ package omnisend
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("X-API-KEY", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-API-KEY", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/openuv/openuv.go b/pkg/detectors/openuv/openuv.go
index e0aa4a6ec..02981b0a3 100644
--- a/pkg/detectors/openuv/openuv.go
+++ b/pkg/detectors/openuv/openuv.go
@@ -2,7 +2,6 @@ package openuv
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("x-access-token", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-access-token", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/pepipost/pepipost.go b/pkg/detectors/pepipost/pepipost.go
index ff7ea50f2..b7b7983fb 100644
--- a/pkg/detectors/pepipost/pepipost.go
+++ b/pkg/detectors/pepipost/pepipost.go
@@ -2,7 +2,6 @@ package pepipost
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("api_key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("api_key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/postman/postman.go b/pkg/detectors/postman/postman.go
index 60424ed89..e5cdfc6f5 100644
--- a/pkg/detectors/postman/postman.go
+++ b/pkg/detectors/postman/postman.go
@@ -2,7 +2,6 @@ package postman
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/postmark/postmark.go b/pkg/detectors/postmark/postmark.go
index 0ea2b93c1..16b64224f 100644
--- a/pkg/detectors/postmark/postmark.go
+++ b/pkg/detectors/postmark/postmark.go
@@ -2,7 +2,6 @@ package postmark
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -53,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
- req.Header.Add("X-Postmark-Server-Token", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-Postmark-Server-Token", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/prospectio/prospectio.go b/pkg/detectors/prospectio/prospectio.go
index cac7262f9..384d531db 100644
--- a/pkg/detectors/prospectio/prospectio.go
+++ b/pkg/detectors/prospectio/prospectio.go
@@ -2,7 +2,6 @@ package prospectio
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("Authorization", resMatch)
req.Header.Add("Content-Type", "application/vnd.api+json; charset=utf-8")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pushbulletapikey/pushbulletapikey.go b/pkg/detectors/pushbulletapikey/pushbulletapikey.go
index 58b19883d..e5e30f870 100644
--- a/pkg/detectors/pushbulletapikey/pushbulletapikey.go
+++ b/pkg/detectors/pushbulletapikey/pushbulletapikey.go
@@ -2,7 +2,6 @@ package pushbulletapikey
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("Access-Token", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("Access-Token", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/qubole/qubole.go b/pkg/detectors/qubole/qubole.go
index b6a82a261..855f091ff 100644
--- a/pkg/detectors/qubole/qubole.go
+++ b/pkg/detectors/qubole/qubole.go
@@ -2,7 +2,6 @@ package qubole
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -54,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
- req.Header.Add("X-AUTH-TOKEN", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-AUTH-TOKEN", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/rapidapi/rapidapi.go b/pkg/detectors/rapidapi/rapidapi.go
index a0d204260..ff3102f31 100644
--- a/pkg/detectors/rapidapi/rapidapi.go
+++ b/pkg/detectors/rapidapi/rapidapi.go
@@ -2,7 +2,6 @@ package rapidapi
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -51,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("x-rapidapi-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-rapidapi-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/rechargepayments/rechargepayments.go b/pkg/detectors/rechargepayments/rechargepayments.go
index 08ba08b20..773a84f9f 100644
--- a/pkg/detectors/rechargepayments/rechargepayments.go
+++ b/pkg/detectors/rechargepayments/rechargepayments.go
@@ -16,7 +16,6 @@ type Scanner struct{}
var _ detectors.Detector = (*Scanner)(nil)
var (
- client = common.SaneHttpClient()
verifyURL = "https://api.rechargeapps.com/token_information"
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
diff --git a/pkg/detectors/scalewaykey/scalewaykey.go b/pkg/detectors/scalewaykey/scalewaykey.go
index caebb591f..c82b4a0d0 100644
--- a/pkg/detectors/scalewaykey/scalewaykey.go
+++ b/pkg/detectors/scalewaykey/scalewaykey.go
@@ -2,7 +2,6 @@ package scalewaykey
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -51,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("X-Auth-Token", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-Auth-Token", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/sendinbluev2/sendinbluev2.go b/pkg/detectors/sendinbluev2/sendinbluev2.go
index f105fa8ff..694737438 100644
--- a/pkg/detectors/sendinbluev2/sendinbluev2.go
+++ b/pkg/detectors/sendinbluev2/sendinbluev2.go
@@ -2,7 +2,6 @@ package sendinbluev2
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -51,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("api-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("api-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/shortcut/shortcut.go b/pkg/detectors/shortcut/shortcut.go
index b60dad85a..e5dd33a3d 100644
--- a/pkg/detectors/shortcut/shortcut.go
+++ b/pkg/detectors/shortcut/shortcut.go
@@ -65,19 +65,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if strings.Contains(body, "app_url") {
s1.Verified = true
- } else {
- // if detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {
- // continue
- // }
}
-
}
-
}
-
results = append(results, s1)
}
-
return results, nil
}
diff --git a/pkg/detectors/skrappio/skrappio.go b/pkg/detectors/skrappio/skrappio.go
index 3efe9f4d8..0634170dd 100644
--- a/pkg/detectors/skrappio/skrappio.go
+++ b/pkg/detectors/skrappio/skrappio.go
@@ -2,7 +2,6 @@ package skrappio
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -53,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("Content-Type", "application/json")
- req.Header.Add("X-Access-Key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-Access-Key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/stormglass/stormglass.go b/pkg/detectors/stormglass/stormglass.go
index 503f6e84d..cc21564fb 100644
--- a/pkg/detectors/stormglass/stormglass.go
+++ b/pkg/detectors/stormglass/stormglass.go
@@ -2,7 +2,6 @@ package stormglass
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/tatumio/tatumio.go b/pkg/detectors/tatumio/tatumio.go
index cd73263da..f98c4fb49 100644
--- a/pkg/detectors/tatumio/tatumio.go
+++ b/pkg/detectors/tatumio/tatumio.go
@@ -2,7 +2,6 @@ package tatumio
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -53,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
req.Header.Add("Accept", "application/vnd.tatumio+json; version=3")
- req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/zonkafeedback/zonkafeedback.go b/pkg/detectors/zonkafeedback/zonkafeedback.go
index d06a92a38..90160fc78 100644
--- a/pkg/detectors/zonkafeedback/zonkafeedback.go
+++ b/pkg/detectors/zonkafeedback/zonkafeedback.go
@@ -2,7 +2,6 @@ package zonkafeedback
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("Z-API-TOKEN", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("Z-API-TOKEN", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index 943a29b82..db1cef9cb 100644
--- a/pkg/sources/git/git.go
+++ b/pkg/sources/git/git.go
@@ -5,7 +5,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"net/url"
"os"
"os/exec"
@@ -257,7 +256,7 @@ func CloneRepo(ctx context.Context, userInfo *url.Userinfo, gitUrl string, args
if err := gitCmdCheck(); err != nil {
return "", nil, err
}
- clonePath, err := ioutil.TempDir(os.TempDir(), "trufflehog")
+ clonePath, err := os.MkdirTemp(os.TempDir(), "trufflehog")
if err != nil {
return "", nil, err
}