Skip to content

Find, verify, and analyze leaked credentials

Run golang lint on entire repo instead of patches (#1214)

Zachary Ricec4f08e3f17b0
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index d43ac2be9..580f8272b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -4,8 +4,6 @@ on:
push:
tags:
- v*
- branches:
- - main
pull_request:
permissions:
@@ -32,11 +30,8 @@ jobs:
# Optional: golangci-lint command line arguments.
args: --enable bodyclose --timeout 10m
- # Optional: show only new issues if it's a pull request. The default value is `false`.
- only-new-issues: true
-
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
- # skip-build-cache: true
\ No newline at end of file
+ # skip-build-cache: true
diff --git a/pkg/detectors/blocknative/blocknative.go b/pkg/detectors/blocknative/blocknative.go
index e3ced7089..2da32a623 100644
--- a/pkg/detectors/blocknative/blocknative.go
+++ b/pkg/detectors/blocknative/blocknative.go
@@ -2,7 +2,6 @@ package blocknative
import (
"context"
- "fmt"
"io"
"net/http"
"regexp"
@@ -53,7 +52,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/coinmarketcap/coinmarketcap.go b/pkg/detectors/coinmarketcap/coinmarketcap.go
index e46468a74..bb75a27b0 100644
--- a/pkg/detectors/coinmarketcap/coinmarketcap.go
+++ b/pkg/detectors/coinmarketcap/coinmarketcap.go
@@ -2,7 +2,6 @@ package coinmarketcap
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -21,13 +20,13 @@ var (
client = common.SaneHttpClient()
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
- keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"coinmarketcap","CMC"}) + `\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\b`)
+ keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"coinmarketcap", "CMC"}) + `\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\b`)
)
// Keywords are used for efficiently pre-filtering chunks.
// Use identifiers in the secret preferably, or the provider name.
func (s Scanner) Keywords() []string {
- return []string{"coinmarketcap","CMC"}
+ return []string{"coinmarketcap", "CMC"}
}
// FromData will find and optionally verify Coinmarketcap secrets in a given set of bytes.
@@ -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-CMC_PRO_API_KEY", fmt.Sprintf("%s", resMatch))
+ req.Header.Add("X-CMC_PRO_API_KEY", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/moralis/moralis.go b/pkg/detectors/moralis/moralis.go
index ebe201a95..cf70f73ae 100644
--- a/pkg/detectors/moralis/moralis.go
+++ b/pkg/detectors/moralis/moralis.go
@@ -2,7 +2,6 @@ package moralis
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-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()