Skip to content

Find, verify, and analyze leaked credentials

chore(detectors): remove match len check (#2746)

Richard Gomez8723f857a2cc
diff --git a/pkg/detectors/abbysale/abbysale.go b/pkg/detectors/abbysale/abbysale.go
index 429bd5070..d9db9d2a4 100644
--- a/pkg/detectors/abbysale/abbysale.go
+++ b/pkg/detectors/abbysale/abbysale.go
@@ -49,9 +49,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/abstract/abstract.go b/pkg/detectors/abstract/abstract.go
index ac40a0a86..66c28c106 100644
--- a/pkg/detectors/abstract/abstract.go
+++ b/pkg/detectors/abstract/abstract.go
@@ -48,9 +48,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/abuseipdb/abuseipdb.go b/pkg/detectors/abuseipdb/abuseipdb.go
index 57f00a053..7ee6c999e 100644
--- a/pkg/detectors/abuseipdb/abuseipdb.go
+++ b/pkg/detectors/abuseipdb/abuseipdb.go
@@ -51,9 +51,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/accuweather/accuweather.go b/pkg/detectors/accuweather/accuweather.go
index c7445075f..0be20747a 100644
--- a/pkg/detectors/accuweather/accuweather.go
+++ b/pkg/detectors/accuweather/accuweather.go
@@ -49,9 +49,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/adafruitio/adafruitio.go b/pkg/detectors/adafruitio/adafruitio.go
index 90820b9ce..d36e82da4 100644
--- a/pkg/detectors/adafruitio/adafruitio.go
+++ b/pkg/detectors/adafruitio/adafruitio.go
@@ -49,9 +49,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/adobeio/adobeio.go b/pkg/detectors/adobeio/adobeio.go
index 507502981..b6461c54e 100644
--- a/pkg/detectors/adobeio/adobeio.go
+++ b/pkg/detectors/adobeio/adobeio.go
@@ -2,10 +2,11 @@ package adobeio
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -40,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/adzuna/adzuna.go b/pkg/detectors/adzuna/adzuna.go
index 395caa3e0..c9b9416b8 100644
--- a/pkg/detectors/adzuna/adzuna.go
+++ b/pkg/detectors/adzuna/adzuna.go
@@ -3,10 +3,11 @@ package adzuna
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -50,15 +51,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/aeroworkflow/aeroworkflow.go b/pkg/detectors/aeroworkflow/aeroworkflow.go
index d5ce4b33f..11b14b5c8 100644
--- a/pkg/detectors/aeroworkflow/aeroworkflow.go
+++ b/pkg/detectors/aeroworkflow/aeroworkflow.go
@@ -52,15 +52,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/agora/agora.go b/pkg/detectors/agora/agora.go
index d2da6f1ec..5ffad3f39 100644
--- a/pkg/detectors/agora/agora.go
+++ b/pkg/detectors/agora/agora.go
@@ -48,23 +48,14 @@ func (s Scanner) getClient() *http.Client {
func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error) {
dataStr := string(data)
- keyMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
+ matches := keyPat.FindAllStringSubmatch(dataStr, -1)
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
- for _, keyMatch := range keyMatches {
- if len(keyMatch) != 2 {
- continue
- }
-
- resMatch := strings.TrimSpace(keyMatch[1])
-
- for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
-
- resSecret := strings.TrimSpace(secretMatch[1])
+ for _, match := range matches {
+ resMatch := strings.TrimSpace(match[1])
+ for _, secret := range secretMatches {
+ resSecret := strings.TrimSpace(secret[1])
/*
as both agora key and secretMatch has same regex, the set of strings keyMatch for both probably me same.
we need to avoid the scenario where key is same as secretMatch. This will reduce the number of matches we process.
diff --git a/pkg/detectors/aha/aha.go b/pkg/detectors/aha/aha.go
index 15c4734d1..a750e763b 100644
--- a/pkg/detectors/aha/aha.go
+++ b/pkg/detectors/aha/aha.go
@@ -49,16 +49,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
resURLMatch := "aha.io"
for _, URLmatch := range URLmatches {
- if len(URLmatch) != 2 {
- continue
- }
resURLMatch = strings.TrimSpace(URLmatch[1])
}
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
index ede8d994a..db1c32b27 100644
--- a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
+++ b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go
index 16ec6b890..467b87eaa 100644
--- a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go
+++ b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/airship/airship.go b/pkg/detectors/airship/airship.go
index 57eabd568..cd64fb22d 100644
--- a/pkg/detectors/airship/airship.go
+++ b/pkg/detectors/airship/airship.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/airvisual/airvisual.go b/pkg/detectors/airvisual/airvisual.go
index 2a8e3ecf2..b0a83359d 100644
--- a/pkg/detectors/airvisual/airvisual.go
+++ b/pkg/detectors/airvisual/airvisual.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/aiven/aiven.go b/pkg/detectors/aiven/aiven.go
index e8514525c..41b9aa2c5 100644
--- a/pkg/detectors/aiven/aiven.go
+++ b/pkg/detectors/aiven/aiven.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/alconost/alconost.go b/pkg/detectors/alconost/alconost.go
index 7b2bb9100..47cad8f8f 100644
--- a/pkg/detectors/alconost/alconost.go
+++ b/pkg/detectors/alconost/alconost.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/aletheiaapi/aletheiaapi.go b/pkg/detectors/aletheiaapi/aletheiaapi.go
index 49efe8550..996022155 100644
--- a/pkg/detectors/aletheiaapi/aletheiaapi.go
+++ b/pkg/detectors/aletheiaapi/aletheiaapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/alibaba/alibaba.go b/pkg/detectors/alibaba/alibaba.go
index 1a6e5504a..b9e4727f1 100644
--- a/pkg/detectors/alibaba/alibaba.go
+++ b/pkg/detectors/alibaba/alibaba.go
@@ -96,15 +96,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/alienvault/alienvault.go b/pkg/detectors/alienvault/alienvault.go
index b8e2f6214..5b3b3b43f 100644
--- a/pkg/detectors/alienvault/alienvault.go
+++ b/pkg/detectors/alienvault/alienvault.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/allsports/allsports.go b/pkg/detectors/allsports/allsports.go
index 68d60a48f..09b33f05b 100644
--- a/pkg/detectors/allsports/allsports.go
+++ b/pkg/detectors/allsports/allsports.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/amadeus/amadeus.go b/pkg/detectors/amadeus/amadeus.go
index ae6dedda7..5383cedac 100644
--- a/pkg/detectors/amadeus/amadeus.go
+++ b/pkg/detectors/amadeus/amadeus.go
@@ -2,11 +2,12 @@ package amadeus
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"io"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -41,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ambee/ambee.go b/pkg/detectors/ambee/ambee.go
index 3d7872e0b..0354c4d20 100644
--- a/pkg/detectors/ambee/ambee.go
+++ b/pkg/detectors/ambee/ambee.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/amplitudeapikey/amplitudeapikey.go b/pkg/detectors/amplitudeapikey/amplitudeapikey.go
index 6e041d760..e3d1f16da 100644
--- a/pkg/detectors/amplitudeapikey/amplitudeapikey.go
+++ b/pkg/detectors/amplitudeapikey/amplitudeapikey.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
// regex for both key and secret are same so the set of strings could possibly be same as well
diff --git a/pkg/detectors/anthropic/anthropic.go b/pkg/detectors/anthropic/anthropic.go
index c6c79c419..cf1d27546 100644
--- a/pkg/detectors/anthropic/anthropic.go
+++ b/pkg/detectors/anthropic/anthropic.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/anypoint/anypoint.go b/pkg/detectors/anypoint/anypoint.go
index d49643ceb..7d779cea8 100644
--- a/pkg/detectors/anypoint/anypoint.go
+++ b/pkg/detectors/anypoint/anypoint.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
orgMatches := orgPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, orgMatch := range orgMatches {
- if len(orgMatch) != 2 {
- continue
- }
orgRes := strings.TrimSpace(orgMatch[1])
// regex for both key and org are same, so to avoid same string processing
diff --git a/pkg/detectors/apacta/apacta.go b/pkg/detectors/apacta/apacta.go
index d490a873e..185d19e65 100644
--- a/pkg/detectors/apacta/apacta.go
+++ b/pkg/detectors/apacta/apacta.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/api2cart/api2cart.go b/pkg/detectors/api2cart/api2cart.go
index d083d96b7..20f371cac 100644
--- a/pkg/detectors/api2cart/api2cart.go
+++ b/pkg/detectors/api2cart/api2cart.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apideck/apideck.go b/pkg/detectors/apideck/apideck.go
index 180f05ecb..40c8d7012 100644
--- a/pkg/detectors/apideck/apideck.go
+++ b/pkg/detectors/apideck/apideck.go
@@ -3,10 +3,11 @@ package apideck
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -41,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idMatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apifonica/apifonica.go b/pkg/detectors/apifonica/apifonica.go
index 904729ec6..420922326 100644
--- a/pkg/detectors/apifonica/apifonica.go
+++ b/pkg/detectors/apifonica/apifonica.go
@@ -40,14 +40,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
tokenMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, tokenMatch := range tokenMatches {
- if len(tokenMatch) != 2 {
- continue
- }
resToken := strings.TrimSpace(tokenMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apify/apify.go b/pkg/detectors/apify/apify.go
index 3aaf778a0..641deead9 100644
--- a/pkg/detectors/apify/apify.go
+++ b/pkg/detectors/apify/apify.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apilayer/apilayer.go b/pkg/detectors/apilayer/apilayer.go
index 35e627886..502e726c1 100644
--- a/pkg/detectors/apilayer/apilayer.go
+++ b/pkg/detectors/apilayer/apilayer.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apimetrics/apimetrics.go b/pkg/detectors/apimetrics/apimetrics.go
index 98c9ec37f..25840f35c 100644
--- a/pkg/detectors/apimetrics/apimetrics.go
+++ b/pkg/detectors/apimetrics/apimetrics.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apitemplate/apitemplate.go b/pkg/detectors/apitemplate/apitemplate.go
index d90e79544..e634a21a4 100644
--- a/pkg/detectors/apitemplate/apitemplate.go
+++ b/pkg/detectors/apitemplate/apitemplate.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apollo/apollo.go b/pkg/detectors/apollo/apollo.go
index ea3423ef3..86e0cd0f6 100644
--- a/pkg/detectors/apollo/apollo.go
+++ b/pkg/detectors/apollo/apollo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/appcues/appcues.go b/pkg/detectors/appcues/appcues.go
index cd98fb021..f03984c9a 100644
--- a/pkg/detectors/appcues/appcues.go
+++ b/pkg/detectors/appcues/appcues.go
@@ -3,10 +3,11 @@ package appcues
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -43,22 +44,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, userMatch := range userMatches {
- if len(userMatch) != 2 {
- continue
- }
resUserMatch := strings.TrimSpace(userMatch[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/appfollow/appfollow.go b/pkg/detectors/appfollow/appfollow.go
index bb5f6e2eb..5f2765526 100644
--- a/pkg/detectors/appfollow/appfollow.go
+++ b/pkg/detectors/appfollow/appfollow.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/appointedd/appointedd.go b/pkg/detectors/appointedd/appointedd.go
index eb19f9e53..9c240ca6d 100644
--- a/pkg/detectors/appointedd/appointedd.go
+++ b/pkg/detectors/appointedd/appointedd.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/appoptics/appoptics.go b/pkg/detectors/appoptics/appoptics.go
index df485794b..5f91103a1 100644
--- a/pkg/detectors/appoptics/appoptics.go
+++ b/pkg/detectors/appoptics/appoptics.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/appsynergy/appsynergy.go b/pkg/detectors/appsynergy/appsynergy.go
index 5b1ed6661..c5014de6a 100644
--- a/pkg/detectors/appsynergy/appsynergy.go
+++ b/pkg/detectors/appsynergy/appsynergy.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/apptivo/apptivo.go b/pkg/detectors/apptivo/apptivo.go
index dd222a954..bd68fc5c1 100644
--- a/pkg/detectors/apptivo/apptivo.go
+++ b/pkg/detectors/apptivo/apptivo.go
@@ -3,11 +3,12 @@ package apptivo
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"io"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -42,14 +43,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/artifactory/artifactory.go b/pkg/detectors/artifactory/artifactory.go
index 92fe66e98..62eb9e6a5 100644
--- a/pkg/detectors/artifactory/artifactory.go
+++ b/pkg/detectors/artifactory/artifactory.go
@@ -51,17 +51,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
resURLMatch := ""
for _, URLmatch := range URLmatches {
- if len(URLmatch) != 2 {
- continue
- }
-
resURLMatch = strings.TrimSpace(URLmatch[1])
}
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
client := s.getClient()
diff --git a/pkg/detectors/artsy/artsy.go b/pkg/detectors/artsy/artsy.go
index 4aaf9e24f..6da207de1 100644
--- a/pkg/detectors/artsy/artsy.go
+++ b/pkg/detectors/artsy/artsy.go
@@ -2,10 +2,11 @@ package artsy
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -40,16 +41,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/asanaoauth/asanaoauth.go b/pkg/detectors/asanaoauth/asanaoauth.go
index 3d07c8f6f..85bcfa31f 100644
--- a/pkg/detectors/asanaoauth/asanaoauth.go
+++ b/pkg/detectors/asanaoauth/asanaoauth.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go
index a0e4740ad..050ea1b6f 100644
--- a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go
+++ b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/assemblyai/assemblyai.go b/pkg/detectors/assemblyai/assemblyai.go
index 0c060de9d..47ef5db0d 100644
--- a/pkg/detectors/assemblyai/assemblyai.go
+++ b/pkg/detectors/assemblyai/assemblyai.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/atera/atera.go b/pkg/detectors/atera/atera.go
index 4141e8ca6..cc7eba7a4 100644
--- a/pkg/detectors/atera/atera.go
+++ b/pkg/detectors/atera/atera.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/audd/audd.go b/pkg/detectors/audd/audd.go
index c55cf2115..d60c9cc65 100644
--- a/pkg/detectors/audd/audd.go
+++ b/pkg/detectors/audd/audd.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
index 95ccaf0e6..d7058f384 100644
--- a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
+++ b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
@@ -45,18 +45,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, managementApiTokenMatch := range managementAPITokenMatches {
- if len(managementApiTokenMatch) != 2 {
- continue
- }
managementAPITokenRes := strings.TrimSpace(managementApiTokenMatch[1])
if len(managementAPITokenRes) < 2000 || len(managementAPITokenRes) > 5000 {
continue
}
for _, domainMatch := range domainMatches {
- if len(domainMatch) != 2 {
- continue
- }
domainRes := strings.TrimSpace(domainMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/auth0oauth/auth0oauth.go b/pkg/detectors/auth0oauth/auth0oauth.go
index 8812703f7..1c7a8a687 100644
--- a/pkg/detectors/auth0oauth/auth0oauth.go
+++ b/pkg/detectors/auth0oauth/auth0oauth.go
@@ -43,21 +43,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, clientIdMatch := range clientIdMatches {
- if len(clientIdMatch) != 2 {
- continue
- }
clientIdRes := strings.TrimSpace(clientIdMatch[1])
for _, clientSecretMatch := range clientSecretMatches {
- if len(clientSecretMatch) != 2 {
- continue
- }
clientSecretRes := strings.TrimSpace(clientSecretMatch[1])
for _, domainMatch := range domainMatches {
- if len(domainMatch) != 2 {
- continue
- }
domainRes := strings.TrimSpace(domainMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/autodesk/autodesk.go b/pkg/detectors/autodesk/autodesk.go
index d3050d742..e30f6ae99 100644
--- a/pkg/detectors/autodesk/autodesk.go
+++ b/pkg/detectors/autodesk/autodesk.go
@@ -3,10 +3,11 @@ package autodesk
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -41,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/autoklose/autoklose.go b/pkg/detectors/autoklose/autoklose.go
index a73b73a95..a34982cc6 100644
--- a/pkg/detectors/autoklose/autoklose.go
+++ b/pkg/detectors/autoklose/autoklose.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/autopilot/autopilot.go b/pkg/detectors/autopilot/autopilot.go
index be4780ef9..617a71a05 100644
--- a/pkg/detectors/autopilot/autopilot.go
+++ b/pkg/detectors/autopilot/autopilot.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/avazapersonalaccesstoken/avazapersonalaccesstoken.go b/pkg/detectors/avazapersonalaccesstoken/avazapersonalaccesstoken.go
index 6ec63f0b2..942742190 100644
--- a/pkg/detectors/avazapersonalaccesstoken/avazapersonalaccesstoken.go
+++ b/pkg/detectors/avazapersonalaccesstoken/avazapersonalaccesstoken.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/aviationstack/aviationstack.go b/pkg/detectors/aviationstack/aviationstack.go
index e38128341..805ac3c77 100644
--- a/pkg/detectors/aviationstack/aviationstack.go
+++ b/pkg/detectors/aviationstack/aviationstack.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/axonaut/axonaut.go b/pkg/detectors/axonaut/axonaut.go
index 7062d23fa..194c0329d 100644
--- a/pkg/detectors/axonaut/axonaut.go
+++ b/pkg/detectors/axonaut/axonaut.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/aylien/aylien.go b/pkg/detectors/aylien/aylien.go
index 1c97248e1..f40c7424f 100644
--- a/pkg/detectors/aylien/aylien.go
+++ b/pkg/detectors/aylien/aylien.go
@@ -2,10 +2,11 @@ package aylien
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -39,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/ayrshare/ayrshare.go b/pkg/detectors/ayrshare/ayrshare.go
index c4204ca7b..df60114f5 100644
--- a/pkg/detectors/ayrshare/ayrshare.go
+++ b/pkg/detectors/ayrshare/ayrshare.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/azuredevopspersonalaccesstoken/azuredevopspersonalaccesstoken.go b/pkg/detectors/azuredevopspersonalaccesstoken/azuredevopspersonalaccesstoken.go
index 3489d4860..d6acb03cc 100644
--- a/pkg/detectors/azuredevopspersonalaccesstoken/azuredevopspersonalaccesstoken.go
+++ b/pkg/detectors/azuredevopspersonalaccesstoken/azuredevopspersonalaccesstoken.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
orgMatches := orgPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, orgMatch := range orgMatches {
- if len(orgMatch) != 2 {
- continue
- }
resOrgMatch := strings.TrimSpace(orgMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/azuresearchadminkey/azuresearchadminkey.go b/pkg/detectors/azuresearchadminkey/azuresearchadminkey.go
index 5cb0cf579..b62778051 100644
--- a/pkg/detectors/azuresearchadminkey/azuresearchadminkey.go
+++ b/pkg/detectors/azuresearchadminkey/azuresearchadminkey.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
serviceMatches := servicePat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, serviceMatch := range serviceMatches {
- if len(serviceMatch) != 2 {
- continue
- }
resServiceMatch := strings.TrimSpace(serviceMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/azuresearchquerykey/azuresearchquerykey.go b/pkg/detectors/azuresearchquerykey/azuresearchquerykey.go
index b685a56b1..34b3fb9d4 100644
--- a/pkg/detectors/azuresearchquerykey/azuresearchquerykey.go
+++ b/pkg/detectors/azuresearchquerykey/azuresearchquerykey.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := urlPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, urlMatch := range urlMatches {
diff --git a/pkg/detectors/bannerbear/bannerbear.go b/pkg/detectors/bannerbear/bannerbear.go
index 6b4a4c320..2e5957a68 100644
--- a/pkg/detectors/bannerbear/bannerbear.go
+++ b/pkg/detectors/bannerbear/bannerbear.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/baremetrics/baremetrics.go b/pkg/detectors/baremetrics/baremetrics.go
index 0d1f014df..0c6d37016 100644
--- a/pkg/detectors/baremetrics/baremetrics.go
+++ b/pkg/detectors/baremetrics/baremetrics.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/beamer/beamer.go b/pkg/detectors/beamer/beamer.go
index 490bcb081..c597fbdcc 100644
--- a/pkg/detectors/beamer/beamer.go
+++ b/pkg/detectors/beamer/beamer.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/beebole/beebole.go b/pkg/detectors/beebole/beebole.go
index 091f4f19c..78687d52a 100644
--- a/pkg/detectors/beebole/beebole.go
+++ b/pkg/detectors/beebole/beebole.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/besnappy/besnappy.go b/pkg/detectors/besnappy/besnappy.go
index e5afc0bcb..effb5248b 100644
--- a/pkg/detectors/besnappy/besnappy.go
+++ b/pkg/detectors/besnappy/besnappy.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/besttime/besttime.go b/pkg/detectors/besttime/besttime.go
index 38edf9176..315950f90 100644
--- a/pkg/detectors/besttime/besttime.go
+++ b/pkg/detectors/besttime/besttime.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/betterstack/betterstack.go b/pkg/detectors/betterstack/betterstack.go
index 0f4ebda82..c822daa30 100644
--- a/pkg/detectors/betterstack/betterstack.go
+++ b/pkg/detectors/betterstack/betterstack.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/billomat/billomat.go b/pkg/detectors/billomat/billomat.go
index 3afe44c97..256da3f6a 100644
--- a/pkg/detectors/billomat/billomat.go
+++ b/pkg/detectors/billomat/billomat.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resId := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bitbar/bitbar.go b/pkg/detectors/bitbar/bitbar.go
index 485c7f9fa..3082383fe 100644
--- a/pkg/detectors/bitbar/bitbar.go
+++ b/pkg/detectors/bitbar/bitbar.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bitcoinaverage/bitcoinaverage.go b/pkg/detectors/bitcoinaverage/bitcoinaverage.go
index 938f1810a..8821f5fe3 100644
--- a/pkg/detectors/bitcoinaverage/bitcoinaverage.go
+++ b/pkg/detectors/bitcoinaverage/bitcoinaverage.go
@@ -43,9 +43,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bitfinex/bitfinex.go b/pkg/detectors/bitfinex/bitfinex.go
index 7df7fd410..353a66151 100644
--- a/pkg/detectors/bitfinex/bitfinex.go
+++ b/pkg/detectors/bitfinex/bitfinex.go
@@ -6,9 +6,9 @@ import (
"net/http"
"strings"
- "github.com/bitfinexcom/bitfinex-api-go/v2/rest"
regexp "github.com/wasilibs/go-re2"
+ "github.com/bitfinexcom/bitfinex-api-go/v2/rest"
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -47,9 +47,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
apiSecretMatches := apiSecretPat.FindAllStringSubmatch(dataStr, -1)
for _, apiKeyMatch := range apiKeyMatches {
- if len(apiKeyMatch) != 2 {
- continue
- }
apiKeyRes := strings.TrimSpace(apiKeyMatch[1])
s1 := detectors.Result{
@@ -58,9 +55,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
for _, apiSecretMatch := range apiSecretMatches {
- if len(apiSecretMatch) != 2 {
- continue
- }
apiSecretRes := strings.TrimSpace(apiSecretMatch[1])
if apiKeyRes == apiSecretRes {
diff --git a/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go b/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go
index f270c6851..4f80d46d9 100644
--- a/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go
+++ b/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bitmex/bitmex.go b/pkg/detectors/bitmex/bitmex.go
index 0d2771c94..aa136bfe9 100644
--- a/pkg/detectors/bitmex/bitmex.go
+++ b/pkg/detectors/bitmex/bitmex.go
@@ -47,15 +47,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/blazemeter/blazemeter.go b/pkg/detectors/blazemeter/blazemeter.go
index 1bb3ef159..1eac63827 100644
--- a/pkg/detectors/blazemeter/blazemeter.go
+++ b/pkg/detectors/blazemeter/blazemeter.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/blitapp/blitapp.go b/pkg/detectors/blitapp/blitapp.go
index a3824c808..8959dc4c8 100644
--- a/pkg/detectors/blitapp/blitapp.go
+++ b/pkg/detectors/blitapp/blitapp.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/blocknative/blocknative.go b/pkg/detectors/blocknative/blocknative.go
index 7edec375f..335107821 100644
--- a/pkg/detectors/blocknative/blocknative.go
+++ b/pkg/detectors/blocknative/blocknative.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/blogger/blogger.go b/pkg/detectors/blogger/blogger.go
index cb93b93e9..800d75c50 100644
--- a/pkg/detectors/blogger/blogger.go
+++ b/pkg/detectors/blogger/blogger.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bombbomb/bombbomb.go b/pkg/detectors/bombbomb/bombbomb.go
index 7b188d6bd..ca1e2a282 100644
--- a/pkg/detectors/bombbomb/bombbomb.go
+++ b/pkg/detectors/bombbomb/bombbomb.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/boostnote/boostnote.go b/pkg/detectors/boostnote/boostnote.go
index c292ad570..4ef5ea55c 100644
--- a/pkg/detectors/boostnote/boostnote.go
+++ b/pkg/detectors/boostnote/boostnote.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/borgbase/borgbase.go b/pkg/detectors/borgbase/borgbase.go
index c7d33b51b..de8daf244 100644
--- a/pkg/detectors/borgbase/borgbase.go
+++ b/pkg/detectors/borgbase/borgbase.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/braintreepayments/braintreepayments.go b/pkg/detectors/braintreepayments/braintreepayments.go
index d06d2ab82..0b01b5caf 100644
--- a/pkg/detectors/braintreepayments/braintreepayments.go
+++ b/pkg/detectors/braintreepayments/braintreepayments.go
@@ -48,15 +48,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/brandfetch/brandfetch.go b/pkg/detectors/brandfetch/brandfetch.go
index efdf4b9b6..6ab54b5e2 100644
--- a/pkg/detectors/brandfetch/brandfetch.go
+++ b/pkg/detectors/brandfetch/brandfetch.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/browserstack/browserstack.go b/pkg/detectors/browserstack/browserstack.go
index 8d726ee1d..b54e17b2a 100644
--- a/pkg/detectors/browserstack/browserstack.go
+++ b/pkg/detectors/browserstack/browserstack.go
@@ -55,15 +55,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
userMatches := userPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, userMatch := range userMatches {
- if len(userMatch) != 2 {
- continue
- }
resUserMatch := strings.TrimSpace(userMatch[1])
diff --git a/pkg/detectors/browshot/browshot.go b/pkg/detectors/browshot/browshot.go
index 23d56572a..71e4f4f6a 100644
--- a/pkg/detectors/browshot/browshot.go
+++ b/pkg/detectors/browshot/browshot.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bscscan/bscscan.go b/pkg/detectors/bscscan/bscscan.go
index 230a00144..6142279f4 100644
--- a/pkg/detectors/bscscan/bscscan.go
+++ b/pkg/detectors/bscscan/bscscan.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/buddyns/buddyns.go b/pkg/detectors/buddyns/buddyns.go
index 4cb234914..dad033366 100644
--- a/pkg/detectors/buddyns/buddyns.go
+++ b/pkg/detectors/buddyns/buddyns.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/budibase/budibase.go b/pkg/detectors/budibase/budibase.go
index 7cbf9742b..62129b06e 100644
--- a/pkg/detectors/budibase/budibase.go
+++ b/pkg/detectors/budibase/budibase.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bugherd/bugherd.go b/pkg/detectors/bugherd/bugherd.go
index 5e4f7c2fd..7120be07b 100644
--- a/pkg/detectors/bugherd/bugherd.go
+++ b/pkg/detectors/bugherd/bugherd.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bugsnag/bugsnag.go b/pkg/detectors/bugsnag/bugsnag.go
index 28a1e196a..15252f04a 100644
--- a/pkg/detectors/bugsnag/bugsnag.go
+++ b/pkg/detectors/bugsnag/bugsnag.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/buildkite/v1/buildkite.go b/pkg/detectors/buildkite/v1/buildkite.go
index 1a4cca6b6..52dd66f88 100644
--- a/pkg/detectors/buildkite/v1/buildkite.go
+++ b/pkg/detectors/buildkite/v1/buildkite.go
@@ -47,9 +47,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/buildkite/v2/buildkite.go b/pkg/detectors/buildkite/v2/buildkite.go
index 1f416bbc2..89c38eff9 100644
--- a/pkg/detectors/buildkite/v2/buildkite.go
+++ b/pkg/detectors/buildkite/v2/buildkite.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/bulbul/bulbul.go b/pkg/detectors/bulbul/bulbul.go
index 0c19c5f91..d3b1aad84 100644
--- a/pkg/detectors/bulbul/bulbul.go
+++ b/pkg/detectors/bulbul/bulbul.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/buttercms/buttercms.go b/pkg/detectors/buttercms/buttercms.go
index 37c77ae12..5944e62dc 100644
--- a/pkg/detectors/buttercms/buttercms.go
+++ b/pkg/detectors/buttercms/buttercms.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/caflou/caflou.go b/pkg/detectors/caflou/caflou.go
index e48ada6b5..3abbe3859 100644
--- a/pkg/detectors/caflou/caflou.go
+++ b/pkg/detectors/caflou/caflou.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/calendarific/calendarific.go b/pkg/detectors/calendarific/calendarific.go
index 58637171b..ff4cd385a 100644
--- a/pkg/detectors/calendarific/calendarific.go
+++ b/pkg/detectors/calendarific/calendarific.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/calendlyapikey/calendlyapikey.go b/pkg/detectors/calendlyapikey/calendlyapikey.go
index f63d96c87..17ec832e1 100644
--- a/pkg/detectors/calendlyapikey/calendlyapikey.go
+++ b/pkg/detectors/calendlyapikey/calendlyapikey.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/calorieninja/calorieninja.go b/pkg/detectors/calorieninja/calorieninja.go
index 362b55f10..0ca01216d 100644
--- a/pkg/detectors/calorieninja/calorieninja.go
+++ b/pkg/detectors/calorieninja/calorieninja.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/campayn/campayn.go b/pkg/detectors/campayn/campayn.go
index c39485ced..018e715b0 100644
--- a/pkg/detectors/campayn/campayn.go
+++ b/pkg/detectors/campayn/campayn.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cannyio/cannyio.go b/pkg/detectors/cannyio/cannyio.go
index 903426d10..c85d2edde 100644
--- a/pkg/detectors/cannyio/cannyio.go
+++ b/pkg/detectors/cannyio/cannyio.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/capsulecrm/capsulecrm.go b/pkg/detectors/capsulecrm/capsulecrm.go
index 46f34b157..3af7c28d0 100644
--- a/pkg/detectors/capsulecrm/capsulecrm.go
+++ b/pkg/detectors/capsulecrm/capsulecrm.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/captaindata/v1/captaindata.go b/pkg/detectors/captaindata/v1/captaindata.go
index dbc811545..61300e3a1 100644
--- a/pkg/detectors/captaindata/v1/captaindata.go
+++ b/pkg/detectors/captaindata/v1/captaindata.go
@@ -44,15 +44,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
projIdMatches := projIdPat.FindAllStringSubmatch(dataStr, -1)
for _, projIdMatch := range projIdMatches {
- if len(projIdMatch) != 2 {
- continue
- }
resProjIdMatch := strings.TrimSpace(projIdMatch[1])
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/carboninterface/carboninterface.go b/pkg/detectors/carboninterface/carboninterface.go
index 977c86549..7c768cae4 100644
--- a/pkg/detectors/carboninterface/carboninterface.go
+++ b/pkg/detectors/carboninterface/carboninterface.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cashboard/cashboard.go b/pkg/detectors/cashboard/cashboard.go
index 364a7d749..7b38ffc11 100644
--- a/pkg/detectors/cashboard/cashboard.go
+++ b/pkg/detectors/cashboard/cashboard.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
userMatches := userPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, userMatch := range userMatches {
- if len(userMatch) != 2 {
- continue
- }
resUser := strings.TrimSpace(userMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/caspio/caspio.go b/pkg/detectors/caspio/caspio.go
index 567ce64a3..3c8f34a0c 100644
--- a/pkg/detectors/caspio/caspio.go
+++ b/pkg/detectors/caspio/caspio.go
@@ -12,7 +12,7 @@ import (
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
)
-type Scanner struct{
+type Scanner struct {
detectors.DefaultMultiPartCredentialProvider
}
@@ -43,22 +43,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
for _, domainMatch := range domainMatches {
- if len(domainMatch) != 2 {
- continue
- }
resDomainMatch := strings.TrimSpace(domainMatch[1])
diff --git a/pkg/detectors/censys/censys.go b/pkg/detectors/censys/censys.go
index 43f8f11c6..01a3b2023 100644
--- a/pkg/detectors/censys/censys.go
+++ b/pkg/detectors/censys/censys.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/centralstationcrm/centralstationcrm.go b/pkg/detectors/centralstationcrm/centralstationcrm.go
index a32a7f953..b4196acb2 100644
--- a/pkg/detectors/centralstationcrm/centralstationcrm.go
+++ b/pkg/detectors/centralstationcrm/centralstationcrm.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cexio/cexio.go b/pkg/detectors/cexio/cexio.go
index 3311240a4..55825f6fa 100644
--- a/pkg/detectors/cexio/cexio.go
+++ b/pkg/detectors/cexio/cexio.go
@@ -51,21 +51,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
userIdMatches := userIdPat.FindAllStringSubmatch(dataStr, -1)
for _, userIdMatch := range userIdMatches {
- if len(userIdMatch) != 2 {
- continue
- }
resUserIdMatch := strings.TrimSpace(userIdMatch[1])
for _, keyMatch := range keyMatches {
- if len(keyMatch) != 2 {
- continue
- }
resKeyMatch := strings.TrimSpace(keyMatch[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/chartmogul/chartmogul.go b/pkg/detectors/chartmogul/chartmogul.go
index 689a54b33..34ad579d2 100644
--- a/pkg/detectors/chartmogul/chartmogul.go
+++ b/pkg/detectors/chartmogul/chartmogul.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/chatbot/chatbot.go b/pkg/detectors/chatbot/chatbot.go
index 16a120073..0ec29b301 100644
--- a/pkg/detectors/chatbot/chatbot.go
+++ b/pkg/detectors/chatbot/chatbot.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/chatfule/chatfule.go b/pkg/detectors/chatfule/chatfule.go
index 067ca140a..252b22ef9 100644
--- a/pkg/detectors/chatfule/chatfule.go
+++ b/pkg/detectors/chatfule/chatfule.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/checio/checio.go b/pkg/detectors/checio/checio.go
index 5563c70b2..6aa684ee2 100644
--- a/pkg/detectors/checio/checio.go
+++ b/pkg/detectors/checio/checio.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/checklyhq/checklyhq.go b/pkg/detectors/checklyhq/checklyhq.go
index 607a331d2..ce3f8d0f5 100644
--- a/pkg/detectors/checklyhq/checklyhq.go
+++ b/pkg/detectors/checklyhq/checklyhq.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/checkout/checkout.go b/pkg/detectors/checkout/checkout.go
index def4425b7..70993b448 100644
--- a/pkg/detectors/checkout/checkout.go
+++ b/pkg/detectors/checkout/checkout.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 3 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/checkvist/checkvist.go b/pkg/detectors/checkvist/checkvist.go
index c9be36dc2..e4e05bad7 100644
--- a/pkg/detectors/checkvist/checkvist.go
+++ b/pkg/detectors/checkvist/checkvist.go
@@ -47,9 +47,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for emailMatch := range uniqueEmailMatches {
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cicero/cicero.go b/pkg/detectors/cicero/cicero.go
index 3d64ae941..2095087ed 100644
--- a/pkg/detectors/cicero/cicero.go
+++ b/pkg/detectors/cicero/cicero.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clarifai/clarifai.go b/pkg/detectors/clarifai/clarifai.go
index 3dce5439c..7b77897b9 100644
--- a/pkg/detectors/clarifai/clarifai.go
+++ b/pkg/detectors/clarifai/clarifai.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clearbit/clearbit.go b/pkg/detectors/clearbit/clearbit.go
index b45a2b28a..92f5a4a0d 100644
--- a/pkg/detectors/clearbit/clearbit.go
+++ b/pkg/detectors/clearbit/clearbit.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clickhelp/clickhelp.go b/pkg/detectors/clickhelp/clickhelp.go
index f258f8dd8..1fa4ec24c 100644
--- a/pkg/detectors/clickhelp/clickhelp.go
+++ b/pkg/detectors/clickhelp/clickhelp.go
@@ -45,20 +45,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
keyMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range serverMatches {
- if len(match) != 2 {
- continue
- }
resServer := strings.TrimSpace(match[1])
for _, emailMatch := range emailMatches {
- if len(emailMatch) != 2 {
- continue
- }
resEmail := strings.TrimSpace(emailMatch[1])
for _, keyMatch := range keyMatches {
- if len(keyMatch) != 2 {
- continue
- }
resKey := strings.TrimSpace(keyMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clicksendsms/clicksendsms.go b/pkg/detectors/clicksendsms/clicksendsms.go
index 67bd60fed..03416b0f9 100644
--- a/pkg/detectors/clicksendsms/clicksendsms.go
+++ b/pkg/detectors/clicksendsms/clicksendsms.go
@@ -43,9 +43,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
resIdMatch := strings.TrimSpace(idMatch[0][strings.LastIndex(idMatch[0], " ")+1:])
diff --git a/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go b/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go
index af57edeba..4502e09ac 100644
--- a/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go
+++ b/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cliengo/cliengo.go b/pkg/detectors/cliengo/cliengo.go
index 3615eef20..bd9d877e9 100644
--- a/pkg/detectors/cliengo/cliengo.go
+++ b/pkg/detectors/cliengo/cliengo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clinchpad/clinchpad.go b/pkg/detectors/clinchpad/clinchpad.go
index c39d9727f..9b025b533 100644
--- a/pkg/detectors/clinchpad/clinchpad.go
+++ b/pkg/detectors/clinchpad/clinchpad.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clockify/clockify.go b/pkg/detectors/clockify/clockify.go
index f89768242..524ca4571 100644
--- a/pkg/detectors/clockify/clockify.go
+++ b/pkg/detectors/clockify/clockify.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clockworksms/clockworksms.go b/pkg/detectors/clockworksms/clockworksms.go
index 3924adcc7..18970c049 100644
--- a/pkg/detectors/clockworksms/clockworksms.go
+++ b/pkg/detectors/clockworksms/clockworksms.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
tokenMatches := tokenPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range userKeyMatches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, tokenMatch := range tokenMatches {
- if len(tokenMatch) != 2 {
- continue
- }
tokenRes := strings.TrimSpace(tokenMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/closecrm/close.go b/pkg/detectors/closecrm/close.go
index 00db62924..47ecc40f6 100644
--- a/pkg/detectors/closecrm/close.go
+++ b/pkg/detectors/closecrm/close.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloudconvert/cloudconvert.go b/pkg/detectors/cloudconvert/cloudconvert.go
index a96555991..835f3e759 100644
--- a/pkg/detectors/cloudconvert/cloudconvert.go
+++ b/pkg/detectors/cloudconvert/cloudconvert.go
@@ -43,9 +43,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloudelements/cloudelements.go b/pkg/detectors/cloudelements/cloudelements.go
index 19002fcdb..c7c4982f4 100644
--- a/pkg/detectors/cloudelements/cloudelements.go
+++ b/pkg/detectors/cloudelements/cloudelements.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
orgMatches := orgPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, orgMatch := range orgMatches {
- if len(orgMatch) != 2 {
- continue
- }
resOrgMatch := strings.TrimSpace(orgMatch[1])
diff --git a/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go b/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go
index 18a7bb610..1e347c56a 100644
--- a/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go
+++ b/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go b/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
index f0cfc2c52..b44853f0f 100644
--- a/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
+++ b/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
@@ -45,9 +45,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
for _, apiKeyMatch := range apiKeyMatches {
- if len(apiKeyMatch) != 2 {
- continue
- }
apiKeyRes := strings.TrimSpace(apiKeyMatch[1])
for emailMatch := range uniqueEmailMatches {
diff --git a/pkg/detectors/cloudimage/cloudimage.go b/pkg/detectors/cloudimage/cloudimage.go
index 06bd2905e..d04e31f2d 100644
--- a/pkg/detectors/cloudimage/cloudimage.go
+++ b/pkg/detectors/cloudimage/cloudimage.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloudmersive/cloudmersive.go b/pkg/detectors/cloudmersive/cloudmersive.go
index 36cc9ae58..85d0abd2c 100644
--- a/pkg/detectors/cloudmersive/cloudmersive.go
+++ b/pkg/detectors/cloudmersive/cloudmersive.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloudplan/cloudplan.go b/pkg/detectors/cloudplan/cloudplan.go
index 7b6c7f328..3c94e2021 100644
--- a/pkg/detectors/cloudplan/cloudplan.go
+++ b/pkg/detectors/cloudplan/cloudplan.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloudsmith/cloudsmith.go b/pkg/detectors/cloudsmith/cloudsmith.go
index 26239c161..157d7184c 100644
--- a/pkg/detectors/cloudsmith/cloudsmith.go
+++ b/pkg/detectors/cloudsmith/cloudsmith.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloverly/cloverly.go b/pkg/detectors/cloverly/cloverly.go
index 3d17b1323..3e775a95d 100644
--- a/pkg/detectors/cloverly/cloverly.go
+++ b/pkg/detectors/cloverly/cloverly.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cloze/cloze.go b/pkg/detectors/cloze/cloze.go
index 010474e7b..a0f0d717e 100644
--- a/pkg/detectors/cloze/cloze.go
+++ b/pkg/detectors/cloze/cloze.go
@@ -47,9 +47,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for emailMatch := range uniqueEmailMatches {
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/clustdoc/clustdoc.go b/pkg/detectors/clustdoc/clustdoc.go
index 14d70d695..ed178a73b 100644
--- a/pkg/detectors/clustdoc/clustdoc.go
+++ b/pkg/detectors/clustdoc/clustdoc.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/coda/coda.go b/pkg/detectors/coda/coda.go
index c4c32d72d..34ab2cbd1 100644
--- a/pkg/detectors/coda/coda.go
+++ b/pkg/detectors/coda/coda.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/codacy/codacy.go b/pkg/detectors/codacy/codacy.go
index bbe419713..fa2b3197d 100644
--- a/pkg/detectors/codacy/codacy.go
+++ b/pkg/detectors/codacy/codacy.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/codeclimate/codeclimate.go b/pkg/detectors/codeclimate/codeclimate.go
index 9b7e4055a..791b1d1d5 100644
--- a/pkg/detectors/codeclimate/codeclimate.go
+++ b/pkg/detectors/codeclimate/codeclimate.go
@@ -45,9 +45,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/codemagic/codemagic.go b/pkg/detectors/codemagic/codemagic.go
index 561f7ba13..d3a455a9e 100644
--- a/pkg/detectors/codemagic/codemagic.go
+++ b/pkg/detectors/codemagic/codemagic.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/codequiry/codequiry.go b/pkg/detectors/codequiry/codequiry.go
index 94dbe6e27..d2a3cce7c 100644
--- a/pkg/detectors/codequiry/codequiry.go
+++ b/pkg/detectors/codequiry/codequiry.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/coinapi/coinapi.go b/pkg/detectors/coinapi/coinapi.go
index ad53f8916..dac83f2a7 100644
--- a/pkg/detectors/coinapi/coinapi.go
+++ b/pkg/detectors/coinapi/coinapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/coinbase/coinbase.go b/pkg/detectors/coinbase/coinbase.go
index 81db4a4df..9726341e3 100644
--- a/pkg/detectors/coinbase/coinbase.go
+++ b/pkg/detectors/coinbase/coinbase.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/coinlayer/coinlayer.go b/pkg/detectors/coinlayer/coinlayer.go
index ba043d25c..280497e50 100644
--- a/pkg/detectors/coinlayer/coinlayer.go
+++ b/pkg/detectors/coinlayer/coinlayer.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/coinlib/coinlib.go b/pkg/detectors/coinlib/coinlib.go
index 92053ed40..949fe4480 100644
--- a/pkg/detectors/coinlib/coinlib.go
+++ b/pkg/detectors/coinlib/coinlib.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/collect2/collect2.go b/pkg/detectors/collect2/collect2.go
index dfa42aef7..52e316d0d 100644
--- a/pkg/detectors/collect2/collect2.go
+++ b/pkg/detectors/collect2/collect2.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/column/column.go b/pkg/detectors/column/column.go
index eed14972e..b33f86277 100644
--- a/pkg/detectors/column/column.go
+++ b/pkg/detectors/column/column.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/commercejs/commercejs.go b/pkg/detectors/commercejs/commercejs.go
index 781fd4591..05de88611 100644
--- a/pkg/detectors/commercejs/commercejs.go
+++ b/pkg/detectors/commercejs/commercejs.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/commodities/commodities.go b/pkg/detectors/commodities/commodities.go
index 9d8d708bb..e68b62387 100644
--- a/pkg/detectors/commodities/commodities.go
+++ b/pkg/detectors/commodities/commodities.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/companyhub/companyhub.go b/pkg/detectors/companyhub/companyhub.go
index 6350835b3..7178cf8e6 100644
--- a/pkg/detectors/companyhub/companyhub.go
+++ b/pkg/detectors/companyhub/companyhub.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/confluent/confluent.go b/pkg/detectors/confluent/confluent.go
index ea73d2bd8..6283e8f7c 100644
--- a/pkg/detectors/confluent/confluent.go
+++ b/pkg/detectors/confluent/confluent.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secret := range secretMatches {
- if len(secret) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secret[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go b/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go
index e8004a608..517951928 100644
--- a/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go
+++ b/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
keyMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range keyMatches {
- if len(match) != 2 {
- continue
- }
keyRes := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/conversiontools/conversiontools.go b/pkg/detectors/conversiontools/conversiontools.go
index f4732bf38..0272ef5c8 100644
--- a/pkg/detectors/conversiontools/conversiontools.go
+++ b/pkg/detectors/conversiontools/conversiontools.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/convertapi/convertapi.go b/pkg/detectors/convertapi/convertapi.go
index 06dbe7d1b..e474f8b4f 100644
--- a/pkg/detectors/convertapi/convertapi.go
+++ b/pkg/detectors/convertapi/convertapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/convertkit/convertkit.go b/pkg/detectors/convertkit/convertkit.go
index 35cb1f139..73d41bf38 100644
--- a/pkg/detectors/convertkit/convertkit.go
+++ b/pkg/detectors/convertkit/convertkit.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/convier/convier.go b/pkg/detectors/convier/convier.go
index c8f714217..e8dd1517d 100644
--- a/pkg/detectors/convier/convier.go
+++ b/pkg/detectors/convier/convier.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/copper/copper.go b/pkg/detectors/copper/copper.go
index ff1ec3c95..5b080bdf8 100644
--- a/pkg/detectors/copper/copper.go
+++ b/pkg/detectors/copper/copper.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/countrylayer/countrylayer.go b/pkg/detectors/countrylayer/countrylayer.go
index 57a402597..a6f251769 100644
--- a/pkg/detectors/countrylayer/countrylayer.go
+++ b/pkg/detectors/countrylayer/countrylayer.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/courier/courier.go b/pkg/detectors/courier/courier.go
index 96db0c1c1..cf9edc530 100644
--- a/pkg/detectors/courier/courier.go
+++ b/pkg/detectors/courier/courier.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/coveralls/coveralls.go b/pkg/detectors/coveralls/coveralls.go
index f22fb29e3..587386841 100644
--- a/pkg/detectors/coveralls/coveralls.go
+++ b/pkg/detectors/coveralls/coveralls.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/craftmypdf/craftmypdf.go b/pkg/detectors/craftmypdf/craftmypdf.go
index 959822a4c..fcbe111c7 100644
--- a/pkg/detectors/craftmypdf/craftmypdf.go
+++ b/pkg/detectors/craftmypdf/craftmypdf.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/crowdin/crowdin.go b/pkg/detectors/crowdin/crowdin.go
index ff3073cf6..5abb5b110 100644
--- a/pkg/detectors/crowdin/crowdin.go
+++ b/pkg/detectors/crowdin/crowdin.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/cryptocompare/cryptocompare.go b/pkg/detectors/cryptocompare/cryptocompare.go
index 02974f301..11bb6fa99 100644
--- a/pkg/detectors/cryptocompare/cryptocompare.go
+++ b/pkg/detectors/cryptocompare/cryptocompare.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/currencycloud/currencycloud.go b/pkg/detectors/currencycloud/currencycloud.go
index adf664b2a..188bacc3c 100644
--- a/pkg/detectors/currencycloud/currencycloud.go
+++ b/pkg/detectors/currencycloud/currencycloud.go
@@ -47,9 +47,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for emailmatch := range uniqueEmailMatches {
diff --git a/pkg/detectors/currencyfreaks/currencyfreaks.go b/pkg/detectors/currencyfreaks/currencyfreaks.go
index 5efc9c7c1..890ef352f 100644
--- a/pkg/detectors/currencyfreaks/currencyfreaks.go
+++ b/pkg/detectors/currencyfreaks/currencyfreaks.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/currencylayer/currencylayer.go b/pkg/detectors/currencylayer/currencylayer.go
index 3bb7966ce..0e50615f8 100644
--- a/pkg/detectors/currencylayer/currencylayer.go
+++ b/pkg/detectors/currencylayer/currencylayer.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/currencyscoop/currencyscoop.go b/pkg/detectors/currencyscoop/currencyscoop.go
index 452d29900..3c6964dbb 100644
--- a/pkg/detectors/currencyscoop/currencyscoop.go
+++ b/pkg/detectors/currencyscoop/currencyscoop.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/currentsapi/currentsapi.go b/pkg/detectors/currentsapi/currentsapi.go
index ae9d3a7fe..25c40281d 100644
--- a/pkg/detectors/currentsapi/currentsapi.go
+++ b/pkg/detectors/currentsapi/currentsapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/customerguru/customerguru.go b/pkg/detectors/customerguru/customerguru.go
index a7fe1690c..94714af81 100644
--- a/pkg/detectors/customerguru/customerguru.go
+++ b/pkg/detectors/customerguru/customerguru.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/customerio/customerio.go b/pkg/detectors/customerio/customerio.go
index 770228a23..743a020b1 100644
--- a/pkg/detectors/customerio/customerio.go
+++ b/pkg/detectors/customerio/customerio.go
@@ -43,14 +43,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CustomerIO,
diff --git a/pkg/detectors/d7network/d7network.go b/pkg/detectors/d7network/d7network.go
index 9002fcd29..7c7b6736b 100644
--- a/pkg/detectors/d7network/d7network.go
+++ b/pkg/detectors/d7network/d7network.go
@@ -34,9 +34,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dailyco/dailyco.go b/pkg/detectors/dailyco/dailyco.go
index a22c78c7a..c4108b49c 100644
--- a/pkg/detectors/dailyco/dailyco.go
+++ b/pkg/detectors/dailyco/dailyco.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dandelion/dandelion.go b/pkg/detectors/dandelion/dandelion.go
index 7b0951b8c..596aeff9c 100644
--- a/pkg/detectors/dandelion/dandelion.go
+++ b/pkg/detectors/dandelion/dandelion.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dareboost/dareboost.go b/pkg/detectors/dareboost/dareboost.go
index 846f2c447..38c52423c 100644
--- a/pkg/detectors/dareboost/dareboost.go
+++ b/pkg/detectors/dareboost/dareboost.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/databox/databox.go b/pkg/detectors/databox/databox.go
index e373d1cc3..ab2da25ca 100644
--- a/pkg/detectors/databox/databox.go
+++ b/pkg/detectors/databox/databox.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/datadogtoken/datadogtoken.go b/pkg/detectors/datadogtoken/datadogtoken.go
index fe7608749..7173dbd73 100644
--- a/pkg/detectors/datadogtoken/datadogtoken.go
+++ b/pkg/detectors/datadogtoken/datadogtoken.go
@@ -106,15 +106,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
apiMatches := apiPat.FindAllStringSubmatch(dataStr, -1)
for _, apiMatch := range apiMatches {
- if len(apiMatch) != 2 {
- continue
- }
resApiMatch := strings.TrimSpace(apiMatch[1])
appIncluded := false
for _, appMatch := range appMatches {
- if len(appMatch) != 2 {
- continue
- }
resAppMatch := strings.TrimSpace(appMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/datagov/datagov.go b/pkg/detectors/datagov/datagov.go
index ac8888530..2c7e7e171 100644
--- a/pkg/detectors/datagov/datagov.go
+++ b/pkg/detectors/datagov/datagov.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/debounce/debounce.go b/pkg/detectors/debounce/debounce.go
index d37dabae3..14d43fc92 100644
--- a/pkg/detectors/debounce/debounce.go
+++ b/pkg/detectors/debounce/debounce.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/deepai/deepai.go b/pkg/detectors/deepai/deepai.go
index 4e61caefc..00ebdc627 100644
--- a/pkg/detectors/deepai/deepai.go
+++ b/pkg/detectors/deepai/deepai.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/deepgram/deepgram.go b/pkg/detectors/deepgram/deepgram.go
index 7f30ad0f0..bfd97da42 100644
--- a/pkg/detectors/deepgram/deepgram.go
+++ b/pkg/detectors/deepgram/deepgram.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/delighted/delighted.go b/pkg/detectors/delighted/delighted.go
index e86a8719e..ff00dfa31 100644
--- a/pkg/detectors/delighted/delighted.go
+++ b/pkg/detectors/delighted/delighted.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/demio/demio.go b/pkg/detectors/demio/demio.go
index d44e70b1d..ce38c691e 100644
--- a/pkg/detectors/demio/demio.go
+++ b/pkg/detectors/demio/demio.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
idMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idMatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/deputy/deputy.go b/pkg/detectors/deputy/deputy.go
index d162d705c..f40775c07 100644
--- a/pkg/detectors/deputy/deputy.go
+++ b/pkg/detectors/deputy/deputy.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := urlPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, urlMatch := range urlMatches {
- if len(urlMatch) != 2 {
- continue
- }
resURL := strings.TrimSpace(urlMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/detectify/detectify.go b/pkg/detectors/detectify/detectify.go
index 41742c5a7..df0c1900b 100644
--- a/pkg/detectors/detectify/detectify.go
+++ b/pkg/detectors/detectify/detectify.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/detectlanguage/detectlanguage.go b/pkg/detectors/detectlanguage/detectlanguage.go
index a171d3b60..4a9e8d248 100644
--- a/pkg/detectors/detectlanguage/detectlanguage.go
+++ b/pkg/detectors/detectlanguage/detectlanguage.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dfuse/dfuse.go b/pkg/detectors/dfuse/dfuse.go
index 3d4e365f8..a32acea28 100644
--- a/pkg/detectors/dfuse/dfuse.go
+++ b/pkg/detectors/dfuse/dfuse.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/diffbot/diffbot.go b/pkg/detectors/diffbot/diffbot.go
index 4bf5700e1..575ee79a9 100644
--- a/pkg/detectors/diffbot/diffbot.go
+++ b/pkg/detectors/diffbot/diffbot.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/diggernaut/diggernaut.go b/pkg/detectors/diggernaut/diggernaut.go
index 75af85988..168da9cba 100644
--- a/pkg/detectors/diggernaut/diggernaut.go
+++ b/pkg/detectors/diggernaut/diggernaut.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/digitaloceantoken/digitaloceantoken.go b/pkg/detectors/digitaloceantoken/digitaloceantoken.go
index 2d0877955..edbaa6e62 100644
--- a/pkg/detectors/digitaloceantoken/digitaloceantoken.go
+++ b/pkg/detectors/digitaloceantoken/digitaloceantoken.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/digitaloceanv2/digitaloceanv2.go b/pkg/detectors/digitaloceanv2/digitaloceanv2.go
index 7b7dec5a0..8e78207f4 100644
--- a/pkg/detectors/digitaloceanv2/digitaloceanv2.go
+++ b/pkg/detectors/digitaloceanv2/digitaloceanv2.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/discordbottoken/discordbottoken.go b/pkg/detectors/discordbottoken/discordbottoken.go
index 8e273c9ff..aeed56051 100644
--- a/pkg/detectors/discordbottoken/discordbottoken.go
+++ b/pkg/detectors/discordbottoken/discordbottoken.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatch := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idMatch {
- if len(match) != 2 {
- continue
- }
resId := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_DiscordBotToken,
diff --git a/pkg/detectors/discordwebhook/discordwebhook.go b/pkg/detectors/discordwebhook/discordwebhook.go
index 8772199ad..8355c4a24 100644
--- a/pkg/detectors/discordwebhook/discordwebhook.go
+++ b/pkg/detectors/discordwebhook/discordwebhook.go
@@ -34,9 +34,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_DiscordWebhook,
diff --git a/pkg/detectors/disqus/disqus.go b/pkg/detectors/disqus/disqus.go
index b4197f232..05b05edd4 100644
--- a/pkg/detectors/disqus/disqus.go
+++ b/pkg/detectors/disqus/disqus.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ditto/ditto.go b/pkg/detectors/ditto/ditto.go
index a26b5f5fc..964e86bc2 100644
--- a/pkg/detectors/ditto/ditto.go
+++ b/pkg/detectors/ditto/ditto.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dnscheck/dnscheck.go b/pkg/detectors/dnscheck/dnscheck.go
index dbdb37717..c2bec252d 100644
--- a/pkg/detectors/dnscheck/dnscheck.go
+++ b/pkg/detectors/dnscheck/dnscheck.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/docparser/docparser.go b/pkg/detectors/docparser/docparser.go
index a12697796..8d4fb4ef8 100644
--- a/pkg/detectors/docparser/docparser.go
+++ b/pkg/detectors/docparser/docparser.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/documo/documo.go b/pkg/detectors/documo/documo.go
index 1d4fcf612..73d0355de 100644
--- a/pkg/detectors/documo/documo.go
+++ b/pkg/detectors/documo/documo.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/docusign/docusign.go b/pkg/detectors/docusign/docusign.go
index da5a818b4..6f2047835 100644
--- a/pkg/detectors/docusign/docusign.go
+++ b/pkg/detectors/docusign/docusign.go
@@ -48,15 +48,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIDMatch := strings.TrimSpace(idMatch[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/doppler/doppler.go b/pkg/detectors/doppler/doppler.go
index 17392c1e1..4ed8dad54 100644
--- a/pkg/detectors/doppler/doppler.go
+++ b/pkg/detectors/doppler/doppler.go
@@ -55,9 +55,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dotmailer/dotmailer.go b/pkg/detectors/dotmailer/dotmailer.go
index 307e9eeec..993fcc2ec 100644
--- a/pkg/detectors/dotmailer/dotmailer.go
+++ b/pkg/detectors/dotmailer/dotmailer.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
passMatches := passPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range passMatches {
- if len(idMatch) != 2 {
- continue
- }
resPassMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/dovico/dovico.go b/pkg/detectors/dovico/dovico.go
index ea4aaf4fa..4f4f847ff 100644
--- a/pkg/detectors/dovico/dovico.go
+++ b/pkg/detectors/dovico/dovico.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
userMatches := userPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, user := range userMatches {
- if len(user) != 2 {
- continue
- }
resUser := strings.TrimSpace(user[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dronahq/dronahq.go b/pkg/detectors/dronahq/dronahq.go
index af88e330c..eb23a8b70 100644
--- a/pkg/detectors/dronahq/dronahq.go
+++ b/pkg/detectors/dronahq/dronahq.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/droneci/droneci.go b/pkg/detectors/droneci/droneci.go
index cebf77370..008451580 100644
--- a/pkg/detectors/droneci/droneci.go
+++ b/pkg/detectors/droneci/droneci.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/duply/duply.go b/pkg/detectors/duply/duply.go
index 38b631000..c5cb0d65f 100644
--- a/pkg/detectors/duply/duply.go
+++ b/pkg/detectors/duply/duply.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dwolla/dwolla.go b/pkg/detectors/dwolla/dwolla.go
index 8708df82c..8cbf58a59 100644
--- a/pkg/detectors/dwolla/dwolla.go
+++ b/pkg/detectors/dwolla/dwolla.go
@@ -43,16 +43,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range idMatches {
- if len(match) != 2 {
- continue
- }
idMatch := strings.TrimSpace(match[1])
for _, secret := range secretMatches {
- if len(secret) != 2 {
- continue
- }
secretMatch := strings.TrimSpace(secret[1])
diff --git a/pkg/detectors/dynalist/dynalist.go b/pkg/detectors/dynalist/dynalist.go
index dca9809f6..4d9da75ae 100644
--- a/pkg/detectors/dynalist/dynalist.go
+++ b/pkg/detectors/dynalist/dynalist.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/dyspatch/dyspatch.go b/pkg/detectors/dyspatch/dyspatch.go
index a7b2f1f43..670389107 100644
--- a/pkg/detectors/dyspatch/dyspatch.go
+++ b/pkg/detectors/dyspatch/dyspatch.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go b/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go
index fef941ee2..36cea7f9c 100644
--- a/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go
+++ b/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
emailMatches := email.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, emailMatch := range emailMatches {
- if len(emailMatch) != 2 {
- continue
- }
resEmailPatMatch := strings.TrimSpace(emailMatch[1])
diff --git a/pkg/detectors/ecostruxureit/ecostruxureit.go b/pkg/detectors/ecostruxureit/ecostruxureit.go
index 19f617b64..de2b7fce8 100644
--- a/pkg/detectors/ecostruxureit/ecostruxureit.go
+++ b/pkg/detectors/ecostruxureit/ecostruxureit.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/edamam/edamam.go b/pkg/detectors/edamam/edamam.go
index 5317adb6d..5a72549dc 100644
--- a/pkg/detectors/edamam/edamam.go
+++ b/pkg/detectors/edamam/edamam.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(match) != 2 {
- continue
- }
resId := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Edamam,
diff --git a/pkg/detectors/edenai/edenai.go b/pkg/detectors/edenai/edenai.go
index ef3dc1244..6eeab40ac 100644
--- a/pkg/detectors/edenai/edenai.go
+++ b/pkg/detectors/edenai/edenai.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/eightxeight/eightxeight.go b/pkg/detectors/eightxeight/eightxeight.go
index 2a94472f9..d2cb05b26 100644
--- a/pkg/detectors/eightxeight/eightxeight.go
+++ b/pkg/detectors/eightxeight/eightxeight.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/elasticemail/elasticemail.go b/pkg/detectors/elasticemail/elasticemail.go
index c92262f07..a8f7d06f9 100644
--- a/pkg/detectors/elasticemail/elasticemail.go
+++ b/pkg/detectors/elasticemail/elasticemail.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/enablex/enablex.go b/pkg/detectors/enablex/enablex.go
index cdb2ebc39..752820657 100644
--- a/pkg/detectors/enablex/enablex.go
+++ b/pkg/detectors/enablex/enablex.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/enigma/enigma.go b/pkg/detectors/enigma/enigma.go
index 99e8ad6f3..3ce901485 100644
--- a/pkg/detectors/enigma/enigma.go
+++ b/pkg/detectors/enigma/enigma.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/envoyapikey/envoyapikey.go b/pkg/detectors/envoyapikey/envoyapikey.go
index c36fd3525..3428ba0b3 100644
--- a/pkg/detectors/envoyapikey/envoyapikey.go
+++ b/pkg/detectors/envoyapikey/envoyapikey.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/etherscan/etherscan.go b/pkg/detectors/etherscan/etherscan.go
index cca0e44a0..b220dc74c 100644
--- a/pkg/detectors/etherscan/etherscan.go
+++ b/pkg/detectors/etherscan/etherscan.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ethplorer/ethplorer.go b/pkg/detectors/ethplorer/ethplorer.go
index e02b0057a..4e3e9713c 100644
--- a/pkg/detectors/ethplorer/ethplorer.go
+++ b/pkg/detectors/ethplorer/ethplorer.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/everhour/everhour.go b/pkg/detectors/everhour/everhour.go
index 7406698e1..1c006493c 100644
--- a/pkg/detectors/everhour/everhour.go
+++ b/pkg/detectors/everhour/everhour.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/exchangerateapi/exchangerateapi.go b/pkg/detectors/exchangerateapi/exchangerateapi.go
index 5da06aad2..7bb78d183 100644
--- a/pkg/detectors/exchangerateapi/exchangerateapi.go
+++ b/pkg/detectors/exchangerateapi/exchangerateapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/exchangeratesapi/exchangeratesapi.go b/pkg/detectors/exchangeratesapi/exchangeratesapi.go
index 1c4f05bbd..12c6934dd 100644
--- a/pkg/detectors/exchangeratesapi/exchangeratesapi.go
+++ b/pkg/detectors/exchangeratesapi/exchangeratesapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/exportsdk/exportsdk.go b/pkg/detectors/exportsdk/exportsdk.go
index b753f6e5b..b27619003 100644
--- a/pkg/detectors/exportsdk/exportsdk.go
+++ b/pkg/detectors/exportsdk/exportsdk.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/extractorapi/extractorapi.go b/pkg/detectors/extractorapi/extractorapi.go
index ece82b7ee..7c939df86 100644
--- a/pkg/detectors/extractorapi/extractorapi.go
+++ b/pkg/detectors/extractorapi/extractorapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/facebookoauth/facebookoauth.go b/pkg/detectors/facebookoauth/facebookoauth.go
index ed0f598f8..8dbfc13c0 100644
--- a/pkg/detectors/facebookoauth/facebookoauth.go
+++ b/pkg/detectors/facebookoauth/facebookoauth.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
apiSecretMatches := apiSecretPat.FindAllStringSubmatch(dataStr, -1)
for _, apiIdMatch := range apiIdMatches {
- if len(apiIdMatch) != 2 {
- continue
- }
apiIdRes := strings.TrimSpace(apiIdMatch[1])
for _, apiSecretMatch := range apiSecretMatches {
- if len(apiSecretMatch) != 2 {
- continue
- }
apiSecretRes := strings.TrimSpace(apiSecretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/faceplusplus/faceplusplus.go b/pkg/detectors/faceplusplus/faceplusplus.go
index 9addc2122..696d62e30 100644
--- a/pkg/detectors/faceplusplus/faceplusplus.go
+++ b/pkg/detectors/faceplusplus/faceplusplus.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fastforex/fastforex.go b/pkg/detectors/fastforex/fastforex.go
index c2ddeee3f..d2c4add49 100644
--- a/pkg/detectors/fastforex/fastforex.go
+++ b/pkg/detectors/fastforex/fastforex.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/feedier/feedier.go b/pkg/detectors/feedier/feedier.go
index 6779d8a0b..da949eb9b 100644
--- a/pkg/detectors/feedier/feedier.go
+++ b/pkg/detectors/feedier/feedier.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fibery/fibery.go b/pkg/detectors/fibery/fibery.go
index 8fdc1093b..cb8b22a6c 100644
--- a/pkg/detectors/fibery/fibery.go
+++ b/pkg/detectors/fibery/fibery.go
@@ -47,15 +47,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, domainMatch := range domainMatches {
- if len(domainMatch) != 2 {
- continue
- }
resDomainMatch := strings.TrimSpace(domainMatch[1])
diff --git a/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.go b/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.go
index 898163ef9..c517ba020 100644
--- a/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.go
+++ b/pkg/detectors/figmapersonalaccesstoken/v1/figmapersonalaccesstoken.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.go b/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.go
index 66c2498e6..dbccf8453 100644
--- a/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.go
+++ b/pkg/detectors/figmapersonalaccesstoken/v2/figmapersonalaccesstoken_v2.go
@@ -46,9 +46,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fileio/fileio.go b/pkg/detectors/fileio/fileio.go
index 0f0ad6c40..73c9338cd 100644
--- a/pkg/detectors/fileio/fileio.go
+++ b/pkg/detectors/fileio/fileio.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/finage/finage.go b/pkg/detectors/finage/finage.go
index 6a83e6172..baf9aa487 100644
--- a/pkg/detectors/finage/finage.go
+++ b/pkg/detectors/finage/finage.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/financialmodelingprep/financialmodelingprep.go b/pkg/detectors/financialmodelingprep/financialmodelingprep.go
index a33a3bf52..1aa759369 100644
--- a/pkg/detectors/financialmodelingprep/financialmodelingprep.go
+++ b/pkg/detectors/financialmodelingprep/financialmodelingprep.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/findl/findl.go b/pkg/detectors/findl/findl.go
index e3d73be1e..c495fc008 100644
--- a/pkg/detectors/findl/findl.go
+++ b/pkg/detectors/findl/findl.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/finnhub/finnhub.go b/pkg/detectors/finnhub/finnhub.go
index feda02d78..ea3ab11f9 100644
--- a/pkg/detectors/finnhub/finnhub.go
+++ b/pkg/detectors/finnhub/finnhub.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fixerio/fixerio.go b/pkg/detectors/fixerio/fixerio.go
index cad7286bb..c6b433801 100644
--- a/pkg/detectors/fixerio/fixerio.go
+++ b/pkg/detectors/fixerio/fixerio.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/flatio/flatio.go b/pkg/detectors/flatio/flatio.go
index 005b0546f..51599f110 100644
--- a/pkg/detectors/flatio/flatio.go
+++ b/pkg/detectors/flatio/flatio.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fleetbase/fleetbase.go b/pkg/detectors/fleetbase/fleetbase.go
index c9ffbd6a3..fe6405815 100644
--- a/pkg/detectors/fleetbase/fleetbase.go
+++ b/pkg/detectors/fleetbase/fleetbase.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/flickr/flickr.go b/pkg/detectors/flickr/flickr.go
index f11c78d96..629da0ea8 100644
--- a/pkg/detectors/flickr/flickr.go
+++ b/pkg/detectors/flickr/flickr.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/flightapi/flightapi.go b/pkg/detectors/flightapi/flightapi.go
index 1c06a02f9..f649e6302 100644
--- a/pkg/detectors/flightapi/flightapi.go
+++ b/pkg/detectors/flightapi/flightapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/flightlabs/flightlabs.go b/pkg/detectors/flightlabs/flightlabs.go
index cc4768205..a33491905 100644
--- a/pkg/detectors/flightlabs/flightlabs.go
+++ b/pkg/detectors/flightlabs/flightlabs.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/flightstats/flightstats.go b/pkg/detectors/flightstats/flightstats.go
index 7615f978b..6517098b2 100644
--- a/pkg/detectors/flightstats/flightstats.go
+++ b/pkg/detectors/flightstats/flightstats.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resId := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/float/float.go b/pkg/detectors/float/float.go
index 0b6f85d2c..5ce95000a 100644
--- a/pkg/detectors/float/float.go
+++ b/pkg/detectors/float/float.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/flowflu/flowflu.go b/pkg/detectors/flowflu/flowflu.go
index 707161a51..5bdb9453e 100644
--- a/pkg/detectors/flowflu/flowflu.go
+++ b/pkg/detectors/flowflu/flowflu.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
accountMatches := accountPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, accountMatch := range accountMatches {
- if len(accountMatch) != 2 {
- continue
- }
resAccount := strings.TrimSpace(accountMatch[1])
diff --git a/pkg/detectors/flutterwave/flutterwave.go b/pkg/detectors/flutterwave/flutterwave.go
index d2758dade..3de6afc2b 100644
--- a/pkg/detectors/flutterwave/flutterwave.go
+++ b/pkg/detectors/flutterwave/flutterwave.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fmfw/fmfw.go b/pkg/detectors/fmfw/fmfw.go
index 77bd4c922..70438465f 100644
--- a/pkg/detectors/fmfw/fmfw.go
+++ b/pkg/detectors/fmfw/fmfw.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/formbucket/formbucket.go b/pkg/detectors/formbucket/formbucket.go
index 98d92ec70..4377a32bb 100644
--- a/pkg/detectors/formbucket/formbucket.go
+++ b/pkg/detectors/formbucket/formbucket.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/formcraft/formcraft.go b/pkg/detectors/formcraft/formcraft.go
index 27e503e57..7d3402843 100644
--- a/pkg/detectors/formcraft/formcraft.go
+++ b/pkg/detectors/formcraft/formcraft.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/formio/formio.go b/pkg/detectors/formio/formio.go
index 29ead08c7..52b3f3670 100644
--- a/pkg/detectors/formio/formio.go
+++ b/pkg/detectors/formio/formio.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/formsite/formsite.go b/pkg/detectors/formsite/formsite.go
index ca03194ca..59344861b 100644
--- a/pkg/detectors/formsite/formsite.go
+++ b/pkg/detectors/formsite/formsite.go
@@ -44,19 +44,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
userMatches := userPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, serverMatch := range serverMatches {
- if len(serverMatch) != 2 {
- continue
- }
resServerMatch := strings.TrimSpace(serverMatch[1])
for _, userMatch := range userMatches {
- if len(userMatch) != 2 {
- continue
- }
resUserMatch := strings.TrimSpace(userMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Formsite,
diff --git a/pkg/detectors/foursquare/foursquare.go b/pkg/detectors/foursquare/foursquare.go
index 100f5e839..b34a53de1 100644
--- a/pkg/detectors/foursquare/foursquare.go
+++ b/pkg/detectors/foursquare/foursquare.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretMatch.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_FourSquare,
diff --git a/pkg/detectors/frameio/frameio.go b/pkg/detectors/frameio/frameio.go
index a9d36d29d..0f1a54e4c 100644
--- a/pkg/detectors/frameio/frameio.go
+++ b/pkg/detectors/frameio/frameio.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/freshbooks/freshbooks.go b/pkg/detectors/freshbooks/freshbooks.go
index a49e87f11..2cef76521 100644
--- a/pkg/detectors/freshbooks/freshbooks.go
+++ b/pkg/detectors/freshbooks/freshbooks.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
uriMatches := uriPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, uriMatch := range uriMatches {
- if len(uriMatch) != 2 {
- continue
- }
resURI := strings.TrimSpace(uriMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/freshdesk/freshdesk.go b/pkg/detectors/freshdesk/freshdesk.go
index 9c793f031..21c513037 100644
--- a/pkg/detectors/freshdesk/freshdesk.go
+++ b/pkg/detectors/freshdesk/freshdesk.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := urlPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, urlMatch := range urlMatches {
- if len(urlMatch) != 2 {
- continue
- }
resURL := strings.TrimSpace(urlMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Freshdesk,
diff --git a/pkg/detectors/front/front.go b/pkg/detectors/front/front.go
index e702e9c26..b413ede5a 100644
--- a/pkg/detectors/front/front.go
+++ b/pkg/detectors/front/front.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fulcrum/fulcrum.go b/pkg/detectors/fulcrum/fulcrum.go
index 2b87587ef..90d5022f5 100644
--- a/pkg/detectors/fulcrum/fulcrum.go
+++ b/pkg/detectors/fulcrum/fulcrum.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fullstory/v1/fullstory.go b/pkg/detectors/fullstory/v1/fullstory.go
index c2f970de8..d2d9665d4 100644
--- a/pkg/detectors/fullstory/v1/fullstory.go
+++ b/pkg/detectors/fullstory/v1/fullstory.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fullstory/v2/fullstory_v2.go b/pkg/detectors/fullstory/v2/fullstory_v2.go
index 7148bc1ea..8ef3df351 100644
--- a/pkg/detectors/fullstory/v2/fullstory_v2.go
+++ b/pkg/detectors/fullstory/v2/fullstory_v2.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/fxmarket/fxmarket.go b/pkg/detectors/fxmarket/fxmarket.go
index ba60c0bec..64adcfe9a 100644
--- a/pkg/detectors/fxmarket/fxmarket.go
+++ b/pkg/detectors/fxmarket/fxmarket.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/geckoboard/geckoboard.go b/pkg/detectors/geckoboard/geckoboard.go
index af980865f..d4878b08a 100644
--- a/pkg/detectors/geckoboard/geckoboard.go
+++ b/pkg/detectors/geckoboard/geckoboard.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/gemini/gemini.go b/pkg/detectors/gemini/gemini.go
index 3ab02a9e9..a9b0679c6 100644
--- a/pkg/detectors/gemini/gemini.go
+++ b/pkg/detectors/gemini/gemini.go
@@ -54,9 +54,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range idMatches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
diff --git a/pkg/detectors/gengo/gengo.go b/pkg/detectors/gengo/gengo.go
index 4ae413511..1b2f6a7d1 100644
--- a/pkg/detectors/gengo/gengo.go
+++ b/pkg/detectors/gengo/gengo.go
@@ -50,15 +50,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/geoapify/geoapify.go b/pkg/detectors/geoapify/geoapify.go
index 590352dd8..a72b38b6a 100644
--- a/pkg/detectors/geoapify/geoapify.go
+++ b/pkg/detectors/geoapify/geoapify.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/geocode/geocode.go b/pkg/detectors/geocode/geocode.go
index 37de3ca20..650818a08 100644
--- a/pkg/detectors/geocode/geocode.go
+++ b/pkg/detectors/geocode/geocode.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/geocodify/geocodify.go b/pkg/detectors/geocodify/geocodify.go
index a25bb8a1d..d5e0a4cd0 100644
--- a/pkg/detectors/geocodify/geocodify.go
+++ b/pkg/detectors/geocodify/geocodify.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/geocodio/geocodio.go b/pkg/detectors/geocodio/geocodio.go
index baea36a86..dfbb316fe 100644
--- a/pkg/detectors/geocodio/geocodio.go
+++ b/pkg/detectors/geocodio/geocodio.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
searchMatches := searchPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, searchMatch := range searchMatches {
- if len(searchMatch) != 2 {
- continue
- }
resSearchMatch := strings.TrimSpace(searchMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/geoipifi/geoipifi.go b/pkg/detectors/geoipifi/geoipifi.go
index 9b5517a96..6f8bb58fc 100644
--- a/pkg/detectors/geoipifi/geoipifi.go
+++ b/pkg/detectors/geoipifi/geoipifi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/getemail/getemail.go b/pkg/detectors/getemail/getemail.go
index ac41a118d..ecfeb074c 100644
--- a/pkg/detectors/getemail/getemail.go
+++ b/pkg/detectors/getemail/getemail.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/getemails/getemails.go b/pkg/detectors/getemails/getemails.go
index 22b6c4163..9acf2688e 100644
--- a/pkg/detectors/getemails/getemails.go
+++ b/pkg/detectors/getemails/getemails.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/getgeoapi/getgeoapi.go b/pkg/detectors/getgeoapi/getgeoapi.go
index d63b4ba2e..2da71d4a3 100644
--- a/pkg/detectors/getgeoapi/getgeoapi.go
+++ b/pkg/detectors/getgeoapi/getgeoapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/getgist/getgist.go b/pkg/detectors/getgist/getgist.go
index 8f87370b3..0e2000a9a 100644
--- a/pkg/detectors/getgist/getgist.go
+++ b/pkg/detectors/getgist/getgist.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/getresponse/getresponse.go b/pkg/detectors/getresponse/getresponse.go
index 562f48527..31dcba5a7 100644
--- a/pkg/detectors/getresponse/getresponse.go
+++ b/pkg/detectors/getresponse/getresponse.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/getsandbox/getsandbox.go b/pkg/detectors/getsandbox/getsandbox.go
index 71f7ade0c..a512f6fe9 100644
--- a/pkg/detectors/getsandbox/getsandbox.go
+++ b/pkg/detectors/getsandbox/getsandbox.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/github/v1/github_old.go b/pkg/detectors/github/v1/github_old.go
index 2ec2a8a56..e61749f78 100644
--- a/pkg/detectors/github/v1/github_old.go
+++ b/pkg/detectors/github/v1/github_old.go
@@ -70,9 +70,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for _, match := range matches {
// First match is entire regex, second is the first group.
- if len(match) != 2 {
- continue
- }
token := match[1]
diff --git a/pkg/detectors/github/v2/github.go b/pkg/detectors/github/v2/github.go
index b185d4cf3..9451de0c0 100644
--- a/pkg/detectors/github/v2/github.go
+++ b/pkg/detectors/github/v2/github.go
@@ -53,9 +53,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for _, match := range matches {
// First match is entire regex, second is the first group.
- if len(match) != 2 {
- continue
- }
token := match[1]
diff --git a/pkg/detectors/github_oauth2/github_oauth2.go b/pkg/detectors/github_oauth2/github_oauth2.go
index aa898ff59..ff9e6ab35 100644
--- a/pkg/detectors/github_oauth2/github_oauth2.go
+++ b/pkg/detectors/github_oauth2/github_oauth2.go
@@ -44,13 +44,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
oauth2ClientSecretMatches := oauth2ClientSecretPat.FindAllStringSubmatch(dataStr, -1)
for _, idMatch := range oauth2ClientIDMatches {
- if len(idMatch) != 2 {
- continue
- }
for _, secretMatch := range oauth2ClientSecretMatches {
- if len(secretMatch) != 2 {
- continue
- }
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_GitHubOauth2,
diff --git a/pkg/detectors/githubapp/githubapp.go b/pkg/detectors/githubapp/githubapp.go
index 89640804b..963516454 100644
--- a/pkg/detectors/githubapp/githubapp.go
+++ b/pkg/detectors/githubapp/githubapp.go
@@ -44,15 +44,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
appMatches := appPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, appMatch := range appMatches {
- if len(appMatch) != 2 {
- continue
- }
appResMatch := strings.TrimSpace(appMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_GitHubApp,
diff --git a/pkg/detectors/gitlab/v1/gitlab.go b/pkg/detectors/gitlab/v1/gitlab.go
index 301d9fb14..d8a9af03a 100644
--- a/pkg/detectors/gitlab/v1/gitlab.go
+++ b/pkg/detectors/gitlab/v1/gitlab.go
@@ -50,9 +50,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
// ignore v2 detectors which have a prefix of `glpat-`
if strings.Contains(match[0], "glpat-") {
continue
diff --git a/pkg/detectors/gitlab/v2/gitlab_v2.go b/pkg/detectors/gitlab/v2/gitlab_v2.go
index 5bfb3f42d..30f42e181 100644
--- a/pkg/detectors/gitlab/v2/gitlab_v2.go
+++ b/pkg/detectors/gitlab/v2/gitlab_v2.go
@@ -43,9 +43,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/gitter/gitter.go b/pkg/detectors/gitter/gitter.go
index a4ce95780..e8d31bae1 100644
--- a/pkg/detectors/gitter/gitter.go
+++ b/pkg/detectors/gitter/gitter.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/glassnode/glassnode.go b/pkg/detectors/glassnode/glassnode.go
index dbef88c75..0ac8d2a65 100644
--- a/pkg/detectors/glassnode/glassnode.go
+++ b/pkg/detectors/glassnode/glassnode.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/gocanvas/gocanvas.go b/pkg/detectors/gocanvas/gocanvas.go
index 6fdb201a3..67bc8ab47 100644
--- a/pkg/detectors/gocanvas/gocanvas.go
+++ b/pkg/detectors/gocanvas/gocanvas.go
@@ -50,9 +50,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for emailMatch := range uniqueEmailMatches {
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/gocardless/gocardless.go b/pkg/detectors/gocardless/gocardless.go
index cdd09c82f..d1df00a49 100644
--- a/pkg/detectors/gocardless/gocardless.go
+++ b/pkg/detectors/gocardless/gocardless.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/goodday/goodday.go b/pkg/detectors/goodday/goodday.go
index cb60ba0ba..f5f3f859d 100644
--- a/pkg/detectors/goodday/goodday.go
+++ b/pkg/detectors/goodday/goodday.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/grafana/grafana.go b/pkg/detectors/grafana/grafana.go
index 7fd472165..6574c650e 100644
--- a/pkg/detectors/grafana/grafana.go
+++ b/pkg/detectors/grafana/grafana.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/grafanaserviceaccount/grafanaserviceaccount.go b/pkg/detectors/grafanaserviceaccount/grafanaserviceaccount.go
index 225582b2c..f4fdb4ad7 100644
--- a/pkg/detectors/grafanaserviceaccount/grafanaserviceaccount.go
+++ b/pkg/detectors/grafanaserviceaccount/grafanaserviceaccount.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range keyMatches {
- if len(match) != 2 {
- continue
- }
key := strings.TrimSpace(match[1])
for _, domainMatch := range domainMatches {
- if len(domainMatch) != 2 {
- continue
- }
domainRes := strings.TrimSpace(domainMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/graphcms/graphcms.go b/pkg/detectors/graphcms/graphcms.go
index 1fca3928d..e01a59fee 100644
--- a/pkg/detectors/graphcms/graphcms.go
+++ b/pkg/detectors/graphcms/graphcms.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/graphhopper/graphhopper.go b/pkg/detectors/graphhopper/graphhopper.go
index f73abffcd..3b423b857 100644
--- a/pkg/detectors/graphhopper/graphhopper.go
+++ b/pkg/detectors/graphhopper/graphhopper.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
dataStr := string(data)
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Graphhopper,
diff --git a/pkg/detectors/groovehq/groovehq.go b/pkg/detectors/groovehq/groovehq.go
index d8407e378..e6658ed38 100644
--- a/pkg/detectors/groovehq/groovehq.go
+++ b/pkg/detectors/groovehq/groovehq.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/gtmetrix/gtmetrix.go b/pkg/detectors/gtmetrix/gtmetrix.go
index 504b65a35..e998cac5f 100644
--- a/pkg/detectors/gtmetrix/gtmetrix.go
+++ b/pkg/detectors/gtmetrix/gtmetrix.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/guardianapi/guardianapi.go b/pkg/detectors/guardianapi/guardianapi.go
index ef24b8913..464261a95 100644
--- a/pkg/detectors/guardianapi/guardianapi.go
+++ b/pkg/detectors/guardianapi/guardianapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/gumroad/gumroad.go b/pkg/detectors/gumroad/gumroad.go
index 54431d32d..e0c9a2c76 100644
--- a/pkg/detectors/gumroad/gumroad.go
+++ b/pkg/detectors/gumroad/gumroad.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/guru/guru.go b/pkg/detectors/guru/guru.go
index 5c99d2ed8..5da8e69af 100644
--- a/pkg/detectors/guru/guru.go
+++ b/pkg/detectors/guru/guru.go
@@ -43,16 +43,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
keyMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range unameMatches {
- if len(match) != 2 {
- continue
- }
unameMatch := strings.TrimSpace(match[1])
for _, secret := range keyMatches {
- if len(secret) != 2 {
- continue
- }
keyMatch := strings.TrimSpace(secret[1])
diff --git a/pkg/detectors/gyazo/gyazo.go b/pkg/detectors/gyazo/gyazo.go
index 4bef7b113..be3725329 100644
--- a/pkg/detectors/gyazo/gyazo.go
+++ b/pkg/detectors/gyazo/gyazo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/happyscribe/happyscribe.go b/pkg/detectors/happyscribe/happyscribe.go
index d19030b20..a830510cb 100644
--- a/pkg/detectors/happyscribe/happyscribe.go
+++ b/pkg/detectors/happyscribe/happyscribe.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/harvest/harvest.go b/pkg/detectors/harvest/harvest.go
index aea93990e..38ac7490c 100644
--- a/pkg/detectors/harvest/harvest.go
+++ b/pkg/detectors/harvest/harvest.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/hellosign/hellosign.go b/pkg/detectors/hellosign/hellosign.go
index ff9272f3f..fc96233b6 100644
--- a/pkg/detectors/hellosign/hellosign.go
+++ b/pkg/detectors/hellosign/hellosign.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/helpcrunch/helpcrunch.go b/pkg/detectors/helpcrunch/helpcrunch.go
index cac7386b7..2c74b734e 100644
--- a/pkg/detectors/helpcrunch/helpcrunch.go
+++ b/pkg/detectors/helpcrunch/helpcrunch.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/helpscout/helpscout.go b/pkg/detectors/helpscout/helpscout.go
index d75854d69..baa07a0df 100644
--- a/pkg/detectors/helpscout/helpscout.go
+++ b/pkg/detectors/helpscout/helpscout.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/hereapi/hereapi.go b/pkg/detectors/hereapi/hereapi.go
index 33e8c6f5b..91e55c91b 100644
--- a/pkg/detectors/hereapi/hereapi.go
+++ b/pkg/detectors/hereapi/hereapi.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
dataStr := string(data)
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/heroku/heroku.go b/pkg/detectors/heroku/heroku.go
index 2aa5f452c..9c70b6668 100644
--- a/pkg/detectors/heroku/heroku.go
+++ b/pkg/detectors/heroku/heroku.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/hive/hive.go b/pkg/detectors/hive/hive.go
index 76c6452fa..fe15b26ce 100644
--- a/pkg/detectors/hive/hive.go
+++ b/pkg/detectors/hive/hive.go
@@ -41,16 +41,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
keyMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range idMatches {
- if len(match) != 2 {
- continue
- }
idMatch := strings.TrimSpace(match[1])
for _, match := range keyMatches {
- if len(match) != 2 {
- continue
- }
keyMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/hiveage/hiveage.go b/pkg/detectors/hiveage/hiveage.go
index e4f7404d4..1791e21ae 100644
--- a/pkg/detectors/hiveage/hiveage.go
+++ b/pkg/detectors/hiveage/hiveage.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/holidayapi/holidayapi.go b/pkg/detectors/holidayapi/holidayapi.go
index ccca807de..6182dae7e 100644
--- a/pkg/detectors/holidayapi/holidayapi.go
+++ b/pkg/detectors/holidayapi/holidayapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/holistic/holistic.go b/pkg/detectors/holistic/holistic.go
index caa059bf0..27ff8071f 100644
--- a/pkg/detectors/holistic/holistic.go
+++ b/pkg/detectors/holistic/holistic.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/honeycomb/honeycomb.go b/pkg/detectors/honeycomb/honeycomb.go
index a78d01613..0b02c5ffd 100644
--- a/pkg/detectors/honeycomb/honeycomb.go
+++ b/pkg/detectors/honeycomb/honeycomb.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/host/host.go b/pkg/detectors/host/host.go
index 8a60a39dc..3fc5b070e 100644
--- a/pkg/detectors/host/host.go
+++ b/pkg/detectors/host/host.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/html2pdf/html2pdf.go b/pkg/detectors/html2pdf/html2pdf.go
index d3d320244..21c10b992 100644
--- a/pkg/detectors/html2pdf/html2pdf.go
+++ b/pkg/detectors/html2pdf/html2pdf.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/huggingface/huggingface.go b/pkg/detectors/huggingface/huggingface.go
index ece0ebfc2..04b610dee 100644
--- a/pkg/detectors/huggingface/huggingface.go
+++ b/pkg/detectors/huggingface/huggingface.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 1 {
- continue
- }
resMatch := strings.TrimSpace(match[0])
s1 := detectors.Result{
diff --git a/pkg/detectors/humanity/humanity.go b/pkg/detectors/humanity/humanity.go
index a94975e1a..bb60ee95d 100644
--- a/pkg/detectors/humanity/humanity.go
+++ b/pkg/detectors/humanity/humanity.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/hunter/hunter.go b/pkg/detectors/hunter/hunter.go
index 76e1f51c4..df2ada6ab 100644
--- a/pkg/detectors/hunter/hunter.go
+++ b/pkg/detectors/hunter/hunter.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/hybiscus/hybiscus.go b/pkg/detectors/hybiscus/hybiscus.go
index f8d1584e3..08430ab4c 100644
--- a/pkg/detectors/hybiscus/hybiscus.go
+++ b/pkg/detectors/hybiscus/hybiscus.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/hypertrack/hypertrack.go b/pkg/detectors/hypertrack/hypertrack.go
index 27e5b4c1b..b554b7038 100644
--- a/pkg/detectors/hypertrack/hypertrack.go
+++ b/pkg/detectors/hypertrack/hypertrack.go
@@ -41,16 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, accMatch := range accMatches {
-
- if len(accMatch) != 2 {
- continue
- }
resAccMatch := strings.TrimSpace(accMatch[1])
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go b/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go
index df05f4e15..b339dbe27 100644
--- a/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go
+++ b/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go
@@ -2,10 +2,11 @@ package ibmclouduserkey
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/iconfinder/iconfinder.go b/pkg/detectors/iconfinder/iconfinder.go
index 5dfcbe84f..ecca5a002 100644
--- a/pkg/detectors/iconfinder/iconfinder.go
+++ b/pkg/detectors/iconfinder/iconfinder.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/iexapis/iexapis.go b/pkg/detectors/iexapis/iexapis.go
index 878518257..5624d7d73 100644
--- a/pkg/detectors/iexapis/iexapis.go
+++ b/pkg/detectors/iexapis/iexapis.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/iexcloud/iexcloud.go b/pkg/detectors/iexcloud/iexcloud.go
index 2f88fda2f..ec4a0b77a 100644
--- a/pkg/detectors/iexcloud/iexcloud.go
+++ b/pkg/detectors/iexcloud/iexcloud.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/imagekit/imagekit.go b/pkg/detectors/imagekit/imagekit.go
index dafed656c..bedbb95d0 100644
--- a/pkg/detectors/imagekit/imagekit.go
+++ b/pkg/detectors/imagekit/imagekit.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/imagga/imagga.go b/pkg/detectors/imagga/imagga.go
index 9561ab7bf..de0e2fb5a 100644
--- a/pkg/detectors/imagga/imagga.go
+++ b/pkg/detectors/imagga/imagga.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/impala/impala.go b/pkg/detectors/impala/impala.go
index 82fb69313..e94a1dfdb 100644
--- a/pkg/detectors/impala/impala.go
+++ b/pkg/detectors/impala/impala.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/infura/infura.go b/pkg/detectors/infura/infura.go
index f5f8f2cbd..0d04cef02 100644
--- a/pkg/detectors/infura/infura.go
+++ b/pkg/detectors/infura/infura.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/insightly/insightly.go b/pkg/detectors/insightly/insightly.go
index 92d1062c5..a985c8ae6 100644
--- a/pkg/detectors/insightly/insightly.go
+++ b/pkg/detectors/insightly/insightly.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/instabot/instabot.go b/pkg/detectors/instabot/instabot.go
index 76724bf14..4ee0f89e4 100644
--- a/pkg/detectors/instabot/instabot.go
+++ b/pkg/detectors/instabot/instabot.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/instamojo/instamojo.go b/pkg/detectors/instamojo/instamojo.go
index c7b263e4f..3ec7af820 100644
--- a/pkg/detectors/instamojo/instamojo.go
+++ b/pkg/detectors/instamojo/instamojo.go
@@ -45,15 +45,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
clientIdmatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range secretMatches {
- if len(match) != 2 {
- continue
- }
resSecret := strings.TrimSpace(match[1])
for _, clientIdMatch := range clientIdmatches {
- if len(clientIdMatch) != 2 {
- continue
- }
resClientId := strings.TrimSpace(clientIdMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/intercom/intercom.go b/pkg/detectors/intercom/intercom.go
index 943ed63df..5e16eca58 100644
--- a/pkg/detectors/intercom/intercom.go
+++ b/pkg/detectors/intercom/intercom.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
dec, err := base64.StdEncoding.DecodeString(resMatch)
diff --git a/pkg/detectors/interseller/interseller.go b/pkg/detectors/interseller/interseller.go
index b62c9cffb..1fdf6d6c6 100644
--- a/pkg/detectors/interseller/interseller.go
+++ b/pkg/detectors/interseller/interseller.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/intrinio/intrinio.go b/pkg/detectors/intrinio/intrinio.go
index c439122a6..6296ed920 100644
--- a/pkg/detectors/intrinio/intrinio.go
+++ b/pkg/detectors/intrinio/intrinio.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/invoiceocean/invoiceocean.go b/pkg/detectors/invoiceocean/invoiceocean.go
index 55791c273..56108eb36 100644
--- a/pkg/detectors/invoiceocean/invoiceocean.go
+++ b/pkg/detectors/invoiceocean/invoiceocean.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := urlPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, urlMatch := range urlMatches {
- if len(urlMatch) != 2 {
- continue
- }
resURL := strings.TrimSpace(urlMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ip2location/ip2location.go b/pkg/detectors/ip2location/ip2location.go
index 97e5601c0..29695fe5e 100644
--- a/pkg/detectors/ip2location/ip2location.go
+++ b/pkg/detectors/ip2location/ip2location.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ipapi/ipapi.go b/pkg/detectors/ipapi/ipapi.go
index d6f4d6ca6..2f8f944d6 100644
--- a/pkg/detectors/ipapi/ipapi.go
+++ b/pkg/detectors/ipapi/ipapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ipgeolocation/ipgeolocation.go b/pkg/detectors/ipgeolocation/ipgeolocation.go
index 00bb11982..3c12cae1e 100644
--- a/pkg/detectors/ipgeolocation/ipgeolocation.go
+++ b/pkg/detectors/ipgeolocation/ipgeolocation.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ipinfo/ipinfo.go b/pkg/detectors/ipinfo/ipinfo.go
index 19dfea18b..83b60b858 100644
--- a/pkg/detectors/ipinfo/ipinfo.go
+++ b/pkg/detectors/ipinfo/ipinfo.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ipinfodb/ipinfodb.go b/pkg/detectors/ipinfodb/ipinfodb.go
index 0492827fc..435686bdd 100644
--- a/pkg/detectors/ipinfodb/ipinfodb.go
+++ b/pkg/detectors/ipinfodb/ipinfodb.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ipquality/ipquality.go b/pkg/detectors/ipquality/ipquality.go
index a68c63404..2fdf8fe1e 100644
--- a/pkg/detectors/ipquality/ipquality.go
+++ b/pkg/detectors/ipquality/ipquality.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ipstack/ipstack.go b/pkg/detectors/ipstack/ipstack.go
index 74a2c8276..afdfa3ccd 100644
--- a/pkg/detectors/ipstack/ipstack.go
+++ b/pkg/detectors/ipstack/ipstack.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_IpStack,
diff --git a/pkg/detectors/jiratoken/v2/jiratoken_v2.go b/pkg/detectors/jiratoken/v2/jiratoken_v2.go
index e4b082fd8..4b0aeaec7 100644
--- a/pkg/detectors/jiratoken/v2/jiratoken_v2.go
+++ b/pkg/detectors/jiratoken/v2/jiratoken_v2.go
@@ -60,14 +60,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
resEmail := strings.TrimSpace(email[1])
for _, token := range tokens {
- if len(token) != 2 {
- continue
- }
resToken := strings.TrimSpace(token[1])
for _, domain := range domains {
- if len(domain) != 2 {
- continue
- }
resDomain := strings.TrimSpace(domain[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/jotform/jotform.go b/pkg/detectors/jotform/jotform.go
index 29ab85b9b..dfaf13389 100644
--- a/pkg/detectors/jotform/jotform.go
+++ b/pkg/detectors/jotform/jotform.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/jumpcloud/jumpcloud.go b/pkg/detectors/jumpcloud/jumpcloud.go
index 7ab9ca143..098e47e75 100644
--- a/pkg/detectors/jumpcloud/jumpcloud.go
+++ b/pkg/detectors/jumpcloud/jumpcloud.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Jumpcloud,
diff --git a/pkg/detectors/jupiterone/jupiterone.go b/pkg/detectors/jupiterone/jupiterone.go
index 26226da04..9fec23f63 100644
--- a/pkg/detectors/jupiterone/jupiterone.go
+++ b/pkg/detectors/jupiterone/jupiterone.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/juro/juro.go b/pkg/detectors/juro/juro.go
index abb36b8a4..f89a88760 100644
--- a/pkg/detectors/juro/juro.go
+++ b/pkg/detectors/juro/juro.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/kanban/kanban.go b/pkg/detectors/kanban/kanban.go
index ba4f1cf2c..ba89de8db 100644
--- a/pkg/detectors/kanban/kanban.go
+++ b/pkg/detectors/kanban/kanban.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := urlPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, urlMatch := range urlMatches {
- if len(urlMatch) != 2 {
- continue
- }
resURL := strings.TrimSpace(urlMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/kanbantool/kanbantool.go b/pkg/detectors/kanbantool/kanbantool.go
index 3715d8236..bca4fc821 100644
--- a/pkg/detectors/kanbantool/kanbantool.go
+++ b/pkg/detectors/kanbantool/kanbantool.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
idMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/karmacrm/karmacrm.go b/pkg/detectors/karmacrm/karmacrm.go
index c54b8046d..d32381c35 100644
--- a/pkg/detectors/karmacrm/karmacrm.go
+++ b/pkg/detectors/karmacrm/karmacrm.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/keenio/keenio.go b/pkg/detectors/keenio/keenio.go
index 9754d818f..bb8e2b529 100644
--- a/pkg/detectors/keenio/keenio.go
+++ b/pkg/detectors/keenio/keenio.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/kickbox/kickbox.go b/pkg/detectors/kickbox/kickbox.go
index 734305f5d..3272d5828 100644
--- a/pkg/detectors/kickbox/kickbox.go
+++ b/pkg/detectors/kickbox/kickbox.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/klaviyo/klaviyo.go b/pkg/detectors/klaviyo/klaviyo.go
index d52646d1b..9d934a96d 100644
--- a/pkg/detectors/klaviyo/klaviyo.go
+++ b/pkg/detectors/klaviyo/klaviyo.go
@@ -52,9 +52,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/klipfolio/klipfolio.go b/pkg/detectors/klipfolio/klipfolio.go
index ded84d68a..7b55dcce4 100644
--- a/pkg/detectors/klipfolio/klipfolio.go
+++ b/pkg/detectors/klipfolio/klipfolio.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/knapsackpro/knapsackpro.go b/pkg/detectors/knapsackpro/knapsackpro.go
index e05f55884..fa3e1d3ef 100644
--- a/pkg/detectors/knapsackpro/knapsackpro.go
+++ b/pkg/detectors/knapsackpro/knapsackpro.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/kontent/kontent.go b/pkg/detectors/kontent/kontent.go
index d361107ca..ef114b33c 100644
--- a/pkg/detectors/kontent/kontent.go
+++ b/pkg/detectors/kontent/kontent.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/kraken/kraken.go b/pkg/detectors/kraken/kraken.go
index af6bd5477..673bf71bb 100644
--- a/pkg/detectors/kraken/kraken.go
+++ b/pkg/detectors/kraken/kraken.go
@@ -50,15 +50,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
privKeyMatches := privKeyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, privKeyMatch := range privKeyMatches {
- if len(privKeyMatch) != 2 {
- continue
- }
resPrivKeyMatch := strings.TrimSpace(privKeyMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/kucoin/kucoin.go b/pkg/detectors/kucoin/kucoin.go
index 5f91c8485..e8f7291d8 100644
--- a/pkg/detectors/kucoin/kucoin.go
+++ b/pkg/detectors/kucoin/kucoin.go
@@ -47,21 +47,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
passphraseMatches := passphrasePat.FindAllStringSubmatch(dataStr, -1)
for _, keyMatch := range keyMatches {
- if len(keyMatch) != 2 {
- continue
- }
resKeyMatch := strings.TrimSpace(keyMatch[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
for _, passphraseMatch := range passphraseMatches {
- if len(passphraseMatch) != 2 {
- continue
- }
resPassphraseMatch := strings.TrimSpace(passphraseMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/kylas/kylas.go b/pkg/detectors/kylas/kylas.go
index 133af0c90..b7e153431 100644
--- a/pkg/detectors/kylas/kylas.go
+++ b/pkg/detectors/kylas/kylas.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/languagelayer/languagelayer.go b/pkg/detectors/languagelayer/languagelayer.go
index 863a26241..9ceee6dea 100644
--- a/pkg/detectors/languagelayer/languagelayer.go
+++ b/pkg/detectors/languagelayer/languagelayer.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/launchdarkly/launchdarkly.go b/pkg/detectors/launchdarkly/launchdarkly.go
index a09db0025..0de008fd3 100644
--- a/pkg/detectors/launchdarkly/launchdarkly.go
+++ b/pkg/detectors/launchdarkly/launchdarkly.go
@@ -57,9 +57,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/leadfeeder/leadfeeder.go b/pkg/detectors/leadfeeder/leadfeeder.go
index f46eeae0c..d38d62931 100644
--- a/pkg/detectors/leadfeeder/leadfeeder.go
+++ b/pkg/detectors/leadfeeder/leadfeeder.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lemlist/lemlist.go b/pkg/detectors/lemlist/lemlist.go
index 9aebed819..9a9205501 100644
--- a/pkg/detectors/lemlist/lemlist.go
+++ b/pkg/detectors/lemlist/lemlist.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lemonsqueezy/lemonsqueezy.go b/pkg/detectors/lemonsqueezy/lemonsqueezy.go
index 6570906ec..0a4482fca 100644
--- a/pkg/detectors/lemonsqueezy/lemonsqueezy.go
+++ b/pkg/detectors/lemonsqueezy/lemonsqueezy.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lendflow/lendflow.go b/pkg/detectors/lendflow/lendflow.go
index 2713f3abf..d8efb4e47 100644
--- a/pkg/detectors/lendflow/lendflow.go
+++ b/pkg/detectors/lendflow/lendflow.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go b/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go
index 719a9a0e2..fa2065f37 100644
--- a/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go
+++ b/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lexigram/lexigram.go b/pkg/detectors/lexigram/lexigram.go
index 165d57f45..5175c5faf 100644
--- a/pkg/detectors/lexigram/lexigram.go
+++ b/pkg/detectors/lexigram/lexigram.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/linearapi/linearapi.go b/pkg/detectors/linearapi/linearapi.go
index 558bac354..62816cae7 100644
--- a/pkg/detectors/linearapi/linearapi.go
+++ b/pkg/detectors/linearapi/linearapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/linemessaging/linemessaging.go b/pkg/detectors/linemessaging/linemessaging.go
index 14f508330..a6bc394c0 100644
--- a/pkg/detectors/linemessaging/linemessaging.go
+++ b/pkg/detectors/linemessaging/linemessaging.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/linenotify/linenotify.go b/pkg/detectors/linenotify/linenotify.go
index 1f6af5853..9f2ad42f4 100644
--- a/pkg/detectors/linenotify/linenotify.go
+++ b/pkg/detectors/linenotify/linenotify.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/linkpreview/linkpreview.go b/pkg/detectors/linkpreview/linkpreview.go
index e7b711a92..51f567a81 100644
--- a/pkg/detectors/linkpreview/linkpreview.go
+++ b/pkg/detectors/linkpreview/linkpreview.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
dataStr := string(data)
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/liveagent/liveagent.go b/pkg/detectors/liveagent/liveagent.go
index 391dcdcfd..de655732d 100644
--- a/pkg/detectors/liveagent/liveagent.go
+++ b/pkg/detectors/liveagent/liveagent.go
@@ -45,16 +45,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, domainMatch := range domainMatches {
- if len(domainMatch) != 2 {
- continue
- }
domainRes := strings.TrimSpace(domainMatch[0])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_LiveAgent,
diff --git a/pkg/detectors/livestorm/livestorm.go b/pkg/detectors/livestorm/livestorm.go
index 93d60f585..5250abc7d 100644
--- a/pkg/detectors/livestorm/livestorm.go
+++ b/pkg/detectors/livestorm/livestorm.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/loadmill/loadmill.go b/pkg/detectors/loadmill/loadmill.go
index 973025177..eeda8ba15 100644
--- a/pkg/detectors/loadmill/loadmill.go
+++ b/pkg/detectors/loadmill/loadmill.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lob/lob.go b/pkg/detectors/lob/lob.go
index 9edf12dcc..945c91b02 100644
--- a/pkg/detectors/lob/lob.go
+++ b/pkg/detectors/lob/lob.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/locationiq/locationiq.go b/pkg/detectors/locationiq/locationiq.go
index 7f5098fac..d8814cbe3 100644
--- a/pkg/detectors/locationiq/locationiq.go
+++ b/pkg/detectors/locationiq/locationiq.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/loggly/loggly.go b/pkg/detectors/loggly/loggly.go
index eb7583a7b..7023e53d4 100644
--- a/pkg/detectors/loggly/loggly.go
+++ b/pkg/detectors/loggly/loggly.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range keyMatches {
- if len(match) != 2 {
- continue
- }
key := strings.TrimSpace(match[1])
for _, domainMatch := range domainMatches {
- if len(domainMatch) != 2 {
- continue
- }
domainRes := strings.TrimSpace(domainMatch[1])
diff --git a/pkg/detectors/loginradius/loginradius.go b/pkg/detectors/loginradius/loginradius.go
index 951bab286..18df0a467 100644
--- a/pkg/detectors/loginradius/loginradius.go
+++ b/pkg/detectors/loginradius/loginradius.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/logzio/logzio.go b/pkg/detectors/logzio/logzio.go
index 36ba06432..a70c7e00d 100644
--- a/pkg/detectors/logzio/logzio.go
+++ b/pkg/detectors/logzio/logzio.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lokalisetoken/lokalisetoken.go b/pkg/detectors/lokalisetoken/lokalisetoken.go
index 9c5d74b0d..c6c604b84 100644
--- a/pkg/detectors/lokalisetoken/lokalisetoken.go
+++ b/pkg/detectors/lokalisetoken/lokalisetoken.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/loyverse/loyverse.go b/pkg/detectors/loyverse/loyverse.go
index 768dca281..8d1a4ec1b 100644
--- a/pkg/detectors/loyverse/loyverse.go
+++ b/pkg/detectors/loyverse/loyverse.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/lunchmoney/lunchmoney.go b/pkg/detectors/lunchmoney/lunchmoney.go
index e1f09af94..c380ceaa1 100644
--- a/pkg/detectors/lunchmoney/lunchmoney.go
+++ b/pkg/detectors/lunchmoney/lunchmoney.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/luno/luno.go b/pkg/detectors/luno/luno.go
index 35fb2d5c3..b9a199606 100644
--- a/pkg/detectors/luno/luno.go
+++ b/pkg/detectors/luno/luno.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/m3o/m3o.go b/pkg/detectors/m3o/m3o.go
index 64677430e..ac618d16b 100644
--- a/pkg/detectors/m3o/m3o.go
+++ b/pkg/detectors/m3o/m3o.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/madkudu/madkudu.go b/pkg/detectors/madkudu/madkudu.go
index 17c85df4b..c82bd6765 100644
--- a/pkg/detectors/madkudu/madkudu.go
+++ b/pkg/detectors/madkudu/madkudu.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/magicbell/magicbell.go b/pkg/detectors/magicbell/magicbell.go
index 99cc7ac4c..a1c761fa8 100644
--- a/pkg/detectors/magicbell/magicbell.go
+++ b/pkg/detectors/magicbell/magicbell.go
@@ -45,9 +45,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
for _, keyMatch := range apiKeyMatches {
- if len(keyMatch) != 2 {
- continue
- }
apiKeyRes := strings.TrimSpace(keyMatch[1])
for emailMatch := range uniqueEmailMatches {
diff --git a/pkg/detectors/magnetic/magnetic.go b/pkg/detectors/magnetic/magnetic.go
index 4f31d8afc..c543cbe92 100644
--- a/pkg/detectors/magnetic/magnetic.go
+++ b/pkg/detectors/magnetic/magnetic.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mailboxlayer/mailboxlayer.go b/pkg/detectors/mailboxlayer/mailboxlayer.go
index a018d3824..5a82eb29f 100644
--- a/pkg/detectors/mailboxlayer/mailboxlayer.go
+++ b/pkg/detectors/mailboxlayer/mailboxlayer.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mailerlite/mailerlite.go b/pkg/detectors/mailerlite/mailerlite.go
index 894c9dc28..7a61a394e 100644
--- a/pkg/detectors/mailerlite/mailerlite.go
+++ b/pkg/detectors/mailerlite/mailerlite.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go b/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go
index 4e3ac0bf8..c61dd0988 100644
--- a/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go
+++ b/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go
@@ -3,10 +3,11 @@ package mailjetbasicauth
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mailjetsms/mailjetsms.go b/pkg/detectors/mailjetsms/mailjetsms.go
index a3296d481..63cf56872 100644
--- a/pkg/detectors/mailjetsms/mailjetsms.go
+++ b/pkg/detectors/mailjetsms/mailjetsms.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mailmodo/mailmodo.go b/pkg/detectors/mailmodo/mailmodo.go
index a7d57e741..0a8f66cf7 100644
--- a/pkg/detectors/mailmodo/mailmodo.go
+++ b/pkg/detectors/mailmodo/mailmodo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mailsac/mailsac.go b/pkg/detectors/mailsac/mailsac.go
index 741fe0ef6..de2330d48 100644
--- a/pkg/detectors/mailsac/mailsac.go
+++ b/pkg/detectors/mailsac/mailsac.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mandrill/mandrill.go b/pkg/detectors/mandrill/mandrill.go
index d10384d29..affe5ad7f 100644
--- a/pkg/detectors/mandrill/mandrill.go
+++ b/pkg/detectors/mandrill/mandrill.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/manifest/manifest.go b/pkg/detectors/manifest/manifest.go
index 3737aac8c..918e1cbc5 100644
--- a/pkg/detectors/manifest/manifest.go
+++ b/pkg/detectors/manifest/manifest.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mapbox/mapbox.go b/pkg/detectors/mapbox/mapbox.go
index 9fd543e88..9e39ef9f2 100644
--- a/pkg/detectors/mapbox/mapbox.go
+++ b/pkg/detectors/mapbox/mapbox.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
resMatch := strings.TrimSpace(match[1])
for i, idMatch := range idMatches {
if i == 11 {
- if len(idMatch) != 2 {
- continue
- }
resId := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mapquest/mapquest.go b/pkg/detectors/mapquest/mapquest.go
index 58f0b919b..a2ae821e9 100644
--- a/pkg/detectors/mapquest/mapquest.go
+++ b/pkg/detectors/mapquest/mapquest.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/marketstack/marketstack.go b/pkg/detectors/marketstack/marketstack.go
index 02e671577..11f7f11e0 100644
--- a/pkg/detectors/marketstack/marketstack.go
+++ b/pkg/detectors/marketstack/marketstack.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go b/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
index 885b096fb..ff488e84a 100644
--- a/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
+++ b/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
@@ -3,10 +3,11 @@ package mattermostpersonaltoken
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -41,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
serverMatches := serverPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, serverMatch := range serverMatches {
- if len(serverMatch) != 2 {
- continue
- }
serverRes := strings.TrimSpace(serverMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mavenlink/mavenlink.go b/pkg/detectors/mavenlink/mavenlink.go
index 3196c9221..8fa62b8a8 100644
--- a/pkg/detectors/mavenlink/mavenlink.go
+++ b/pkg/detectors/mavenlink/mavenlink.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/maxmindlicense/v1/maxmindlicense.go b/pkg/detectors/maxmindlicense/v1/maxmindlicense.go
index aeddb9ab2..a7c2b3d4a 100644
--- a/pkg/detectors/maxmindlicense/v1/maxmindlicense.go
+++ b/pkg/detectors/maxmindlicense/v1/maxmindlicense.go
@@ -46,9 +46,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
keyRes := strings.TrimSpace(keyMatch[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
idRes := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/meaningcloud/meaningcloud.go b/pkg/detectors/meaningcloud/meaningcloud.go
index 6ecd8d558..ee5543b0e 100644
--- a/pkg/detectors/meaningcloud/meaningcloud.go
+++ b/pkg/detectors/meaningcloud/meaningcloud.go
@@ -44,9 +44,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mediastack/mediastack.go b/pkg/detectors/mediastack/mediastack.go
index 21a5f56a1..ea9a27d13 100644
--- a/pkg/detectors/mediastack/mediastack.go
+++ b/pkg/detectors/mediastack/mediastack.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/meistertask/meistertask.go b/pkg/detectors/meistertask/meistertask.go
index 6477183fd..50d808745 100644
--- a/pkg/detectors/meistertask/meistertask.go
+++ b/pkg/detectors/meistertask/meistertask.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mesibo/mesibo.go b/pkg/detectors/mesibo/mesibo.go
index f2d8460f6..2fb5a61b4 100644
--- a/pkg/detectors/mesibo/mesibo.go
+++ b/pkg/detectors/mesibo/mesibo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/messagebird/messagebird.go b/pkg/detectors/messagebird/messagebird.go
index 6582f8acf..c1873bd34 100644
--- a/pkg/detectors/messagebird/messagebird.go
+++ b/pkg/detectors/messagebird/messagebird.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/metaapi/metaapi.go b/pkg/detectors/metaapi/metaapi.go
index 76b32a652..bc4b38e7b 100644
--- a/pkg/detectors/metaapi/metaapi.go
+++ b/pkg/detectors/metaapi/metaapi.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
spellMatches := spellPat.FindAllStringSubmatch(dataStr, -1)
for _, spellMatch := range spellMatches {
- if len(spellMatch) != 2 {
- continue
- }
resSpellMatch := strings.TrimSpace(spellMatch[1])
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/metabase/metabase.go b/pkg/detectors/metabase/metabase.go
index ebd7647d7..dec38f06b 100644
--- a/pkg/detectors/metabase/metabase.go
+++ b/pkg/detectors/metabase/metabase.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := baseURL.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, urlMatch := range urlMatches {
- if len(urlMatch) != 2 {
- continue
- }
resURLMatch := strings.TrimSpace(urlMatch[1])
u, err := detectors.ParseURLAndStripPathAndParams(resURLMatch)
diff --git a/pkg/detectors/metrilo/metrilo.go b/pkg/detectors/metrilo/metrilo.go
index 5ac1bce05..1d340ae15 100644
--- a/pkg/detectors/metrilo/metrilo.go
+++ b/pkg/detectors/metrilo/metrilo.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go b/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go
index c58a59205..f444e0374 100644
--- a/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go
+++ b/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mindmeister/mindmeister.go b/pkg/detectors/mindmeister/mindmeister.go
index 0f1f2f8f5..2bcb1bdf5 100644
--- a/pkg/detectors/mindmeister/mindmeister.go
+++ b/pkg/detectors/mindmeister/mindmeister.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/miro/miro.go b/pkg/detectors/miro/miro.go
index 0f8e076ed..7e82342b3 100644
--- a/pkg/detectors/miro/miro.go
+++ b/pkg/detectors/miro/miro.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mite/mite.go b/pkg/detectors/mite/mite.go
index efb144660..d95dbc9b9 100644
--- a/pkg/detectors/mite/mite.go
+++ b/pkg/detectors/mite/mite.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := urlPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, urlMatch := range urlMatches {
- if len(urlMatch) != 2 {
- continue
- }
resURL := strings.TrimSpace(urlMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mixmax/mixmax.go b/pkg/detectors/mixmax/mixmax.go
index 3e2ffea25..3a7681c78 100644
--- a/pkg/detectors/mixmax/mixmax.go
+++ b/pkg/detectors/mixmax/mixmax.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mixpanel/mixpanel.go b/pkg/detectors/mixpanel/mixpanel.go
index 486a1164c..339254389 100644
--- a/pkg/detectors/mixpanel/mixpanel.go
+++ b/pkg/detectors/mixpanel/mixpanel.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/mockaroo/mockaroo.go b/pkg/detectors/mockaroo/mockaroo.go
index 43e378236..6967c2e7c 100644
--- a/pkg/detectors/mockaroo/mockaroo.go
+++ b/pkg/detectors/mockaroo/mockaroo.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/moderation/moderation.go b/pkg/detectors/moderation/moderation.go
index c97dd344d..fcadef71d 100644
--- a/pkg/detectors/moderation/moderation.go
+++ b/pkg/detectors/moderation/moderation.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/monday/monday.go b/pkg/detectors/monday/monday.go
index 49cbd481f..eda044859 100644
--- a/pkg/detectors/monday/monday.go
+++ b/pkg/detectors/monday/monday.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/monkeylearn/monkeylearn.go b/pkg/detectors/monkeylearn/monkeylearn.go
index 57c51819a..d354c6d41 100644
--- a/pkg/detectors/monkeylearn/monkeylearn.go
+++ b/pkg/detectors/monkeylearn/monkeylearn.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/moonclerk/moonclerk.go b/pkg/detectors/moonclerk/moonclerk.go
index e7d63eb57..b9b9ed88b 100644
--- a/pkg/detectors/moonclerk/moonclerk.go
+++ b/pkg/detectors/moonclerk/moonclerk.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/moosend/moosend.go b/pkg/detectors/moosend/moosend.go
index 17c2d2a19..e5080750f 100644
--- a/pkg/detectors/moosend/moosend.go
+++ b/pkg/detectors/moosend/moosend.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/moralis/moralis.go b/pkg/detectors/moralis/moralis.go
index 178adb65f..5d4dfb226 100644
--- a/pkg/detectors/moralis/moralis.go
+++ b/pkg/detectors/moralis/moralis.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mrticktock/mrticktock.go b/pkg/detectors/mrticktock/mrticktock.go
index f1e117aba..3240496aa 100644
--- a/pkg/detectors/mrticktock/mrticktock.go
+++ b/pkg/detectors/mrticktock/mrticktock.go
@@ -48,9 +48,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for emailMatch := range uniqueEmailMatches {
for _, passwordMatch := range passwordMatches {
- if len(passwordMatch) != 2 {
- continue
- }
resPassword := strings.TrimSpace(passwordMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/mux/mux.go b/pkg/detectors/mux/mux.go
index a302f58f6..d58e9f557 100644
--- a/pkg/detectors/mux/mux.go
+++ b/pkg/detectors/mux/mux.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/myfreshworks/myfreshworks.go b/pkg/detectors/myfreshworks/myfreshworks.go
index fb0fb1bee..008ef1df8 100644
--- a/pkg/detectors/myfreshworks/myfreshworks.go
+++ b/pkg/detectors/myfreshworks/myfreshworks.go
@@ -43,14 +43,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/myintervals/myintervals.go b/pkg/detectors/myintervals/myintervals.go
index 5b6f83631..2cc727f37 100644
--- a/pkg/detectors/myintervals/myintervals.go
+++ b/pkg/detectors/myintervals/myintervals.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go b/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go
index 745c01665..920f58e08 100644
--- a/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go
+++ b/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/nethunt/nethunt.go b/pkg/detectors/nethunt/nethunt.go
index 9acb19c48..94c6f8c20 100644
--- a/pkg/detectors/nethunt/nethunt.go
+++ b/pkg/detectors/nethunt/nethunt.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/netlify/netlify.go b/pkg/detectors/netlify/netlify.go
index c2bde5341..6995b81ca 100644
--- a/pkg/detectors/netlify/netlify.go
+++ b/pkg/detectors/netlify/netlify.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/neutrinoapi/neutrinoapi.go b/pkg/detectors/neutrinoapi/neutrinoapi.go
index 1b7866670..54ef332f5 100644
--- a/pkg/detectors/neutrinoapi/neutrinoapi.go
+++ b/pkg/detectors/neutrinoapi/neutrinoapi.go
@@ -44,15 +44,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go b/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
index f50ef1ade..ce1b72017 100644
--- a/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
+++ b/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
@@ -2,10 +2,11 @@ package newrelicpersonalapikey
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/newsapi/newsapi.go b/pkg/detectors/newsapi/newsapi.go
index f282edd12..785e137f2 100644
--- a/pkg/detectors/newsapi/newsapi.go
+++ b/pkg/detectors/newsapi/newsapi.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/newscatcher/newscatcher.go b/pkg/detectors/newscatcher/newscatcher.go
index a22c0df36..3c70f4fd2 100644
--- a/pkg/detectors/newscatcher/newscatcher.go
+++ b/pkg/detectors/newscatcher/newscatcher.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/nexmoapikey/nexmoapikey.go b/pkg/detectors/nexmoapikey/nexmoapikey.go
index 17192ae91..a7a5d7715 100644
--- a/pkg/detectors/nexmoapikey/nexmoapikey.go
+++ b/pkg/detectors/nexmoapikey/nexmoapikey.go
@@ -11,7 +11,7 @@ import (
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
)
-type Scanner struct{
+type Scanner struct {
detectors.DefaultMultiPartCredentialProvider
}
@@ -40,14 +40,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretPat := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretPat {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/nftport/nftport.go b/pkg/detectors/nftport/nftport.go
index e98873215..5fea08fa4 100644
--- a/pkg/detectors/nftport/nftport.go
+++ b/pkg/detectors/nftport/nftport.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ngc/ngc.go b/pkg/detectors/ngc/ngc.go
index 9488b0e74..4a2590964 100644
--- a/pkg/detectors/ngc/ngc.go
+++ b/pkg/detectors/ngc/ngc.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat1.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
decode, _ := base64.StdEncoding.DecodeString(resMatch)
diff --git a/pkg/detectors/ngrok/ngrok.go b/pkg/detectors/ngrok/ngrok.go
index c4a95a43a..95dd10fa5 100644
--- a/pkg/detectors/ngrok/ngrok.go
+++ b/pkg/detectors/ngrok/ngrok.go
@@ -34,9 +34,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/nicereply/nicereply.go b/pkg/detectors/nicereply/nicereply.go
index 376df754f..d2e3376d7 100644
--- a/pkg/detectors/nicereply/nicereply.go
+++ b/pkg/detectors/nicereply/nicereply.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/nightfall/nightfall.go b/pkg/detectors/nightfall/nightfall.go
index 956b47550..ce147fd8f 100644
--- a/pkg/detectors/nightfall/nightfall.go
+++ b/pkg/detectors/nightfall/nightfall.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/nimble/nimble.go b/pkg/detectors/nimble/nimble.go
index 637d55788..134d8bc94 100644
--- a/pkg/detectors/nimble/nimble.go
+++ b/pkg/detectors/nimble/nimble.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/noticeable/noticeable.go b/pkg/detectors/noticeable/noticeable.go
index 61eb2ec02..ac244ad56 100644
--- a/pkg/detectors/noticeable/noticeable.go
+++ b/pkg/detectors/noticeable/noticeable.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/notion/notion.go b/pkg/detectors/notion/notion.go
index d91b2a82f..3d33a4121 100644
--- a/pkg/detectors/notion/notion.go
+++ b/pkg/detectors/notion/notion.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Notion,
diff --git a/pkg/detectors/nozbeteams/nozbeteams.go b/pkg/detectors/nozbeteams/nozbeteams.go
index 45e5c2b21..39b90d25a 100644
--- a/pkg/detectors/nozbeteams/nozbeteams.go
+++ b/pkg/detectors/nozbeteams/nozbeteams.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/npmtoken/npmtoken.go b/pkg/detectors/npmtoken/npmtoken.go
index 07f96bfc7..fdd4992f8 100644
--- a/pkg/detectors/npmtoken/npmtoken.go
+++ b/pkg/detectors/npmtoken/npmtoken.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
dataStr := string(data)
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/npmtokenv2/npmtokenv2.go b/pkg/detectors/npmtokenv2/npmtokenv2.go
index 5353e5f5f..3e2eb83b7 100644
--- a/pkg/detectors/npmtokenv2/npmtokenv2.go
+++ b/pkg/detectors/npmtokenv2/npmtokenv2.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := match[1]
s1 := detectors.Result{
diff --git a/pkg/detectors/nugetapikey/nugetapikey.go b/pkg/detectors/nugetapikey/nugetapikey.go
index 1d3fbc7b7..550c3d02a 100644
--- a/pkg/detectors/nugetapikey/nugetapikey.go
+++ b/pkg/detectors/nugetapikey/nugetapikey.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/numverify/numverify.go b/pkg/detectors/numverify/numverify.go
index 307ba49d8..114caea08 100644
--- a/pkg/detectors/numverify/numverify.go
+++ b/pkg/detectors/numverify/numverify.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
dataStr := string(data)
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Numverify,
diff --git a/pkg/detectors/nutritionix/nutritionix.go b/pkg/detectors/nutritionix/nutritionix.go
index 11c399d98..c3c758439 100644
--- a/pkg/detectors/nutritionix/nutritionix.go
+++ b/pkg/detectors/nutritionix/nutritionix.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/nylas/nylas.go b/pkg/detectors/nylas/nylas.go
index f384701e9..10f98ed55 100644
--- a/pkg/detectors/nylas/nylas.go
+++ b/pkg/detectors/nylas/nylas.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/oanda/oanda.go b/pkg/detectors/oanda/oanda.go
index ec96c5c8e..1cfce104c 100644
--- a/pkg/detectors/oanda/oanda.go
+++ b/pkg/detectors/oanda/oanda.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/omnisend/omnisend.go b/pkg/detectors/omnisend/omnisend.go
index 681d2b035..e2f38ed49 100644
--- a/pkg/detectors/omnisend/omnisend.go
+++ b/pkg/detectors/omnisend/omnisend.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/onedesk/onedesk.go b/pkg/detectors/onedesk/onedesk.go
index b339f2861..6776cf1c0 100644
--- a/pkg/detectors/onedesk/onedesk.go
+++ b/pkg/detectors/onedesk/onedesk.go
@@ -48,9 +48,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for emailMatch := range uniqueEmailMatches {
for _, pwordMatch := range pwordMatches {
- if len(pwordMatch) != 2 {
- continue
- }
resPword := strings.TrimSpace(pwordMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/onelogin/onelogin.go b/pkg/detectors/onelogin/onelogin.go
index d3d5b25ac..f3606c9ca 100644
--- a/pkg/detectors/onelogin/onelogin.go
+++ b/pkg/detectors/onelogin/onelogin.go
@@ -41,13 +41,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
dataStr := string(data)
for _, clientID := range oauthClientIDPat.FindAllStringSubmatch(dataStr, -1) {
- if len(clientID) != 2 {
- continue
- }
for _, clientSecret := range oauthClientSecretPat.FindAllStringSubmatch(dataStr, -1) {
- if len(clientSecret) != 2 {
- continue
- }
result := detectors.Result{
DetectorType: detectorspb.DetectorType_OneLogin,
diff --git a/pkg/detectors/onepagecrm/onepagecrm.go b/pkg/detectors/onepagecrm/onepagecrm.go
index ee84c94d1..fd1a35da1 100644
--- a/pkg/detectors/onepagecrm/onepagecrm.go
+++ b/pkg/detectors/onepagecrm/onepagecrm.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/onesignal/onesignal.go b/pkg/detectors/onesignal/onesignal.go
index c4377792c..e7a35f710 100644
--- a/pkg/detectors/onesignal/onesignal.go
+++ b/pkg/detectors/onesignal/onesignal.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/oopspam/oopspam.go b/pkg/detectors/oopspam/oopspam.go
index b2bc46375..a77f66585 100644
--- a/pkg/detectors/oopspam/oopspam.go
+++ b/pkg/detectors/oopspam/oopspam.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/opencagedata/opencagedata.go b/pkg/detectors/opencagedata/opencagedata.go
index 892f6358a..89dc18d95 100644
--- a/pkg/detectors/opencagedata/opencagedata.go
+++ b/pkg/detectors/opencagedata/opencagedata.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/openuv/openuv.go b/pkg/detectors/openuv/openuv.go
index d3028a534..cf50b0a17 100644
--- a/pkg/detectors/openuv/openuv.go
+++ b/pkg/detectors/openuv/openuv.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/openweather/openweather.go b/pkg/detectors/openweather/openweather.go
index f11560412..b3458e160 100644
--- a/pkg/detectors/openweather/openweather.go
+++ b/pkg/detectors/openweather/openweather.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/optimizely/optimizely.go b/pkg/detectors/optimizely/optimizely.go
index 3513ba9cd..ea1106f02 100644
--- a/pkg/detectors/optimizely/optimizely.go
+++ b/pkg/detectors/optimizely/optimizely.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/overloop/overloop.go b/pkg/detectors/overloop/overloop.go
index d5600bceb..b63c6d5a4 100644
--- a/pkg/detectors/overloop/overloop.go
+++ b/pkg/detectors/overloop/overloop.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/owlbot/owlbot.go b/pkg/detectors/owlbot/owlbot.go
index 081313626..dcccb8085 100644
--- a/pkg/detectors/owlbot/owlbot.go
+++ b/pkg/detectors/owlbot/owlbot.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/packagecloud/packagecloud.go b/pkg/detectors/packagecloud/packagecloud.go
index 75224ea07..a348e1c1e 100644
--- a/pkg/detectors/packagecloud/packagecloud.go
+++ b/pkg/detectors/packagecloud/packagecloud.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go b/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go
index ad2db0e56..09c72e178 100644
--- a/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go
+++ b/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go
@@ -3,10 +3,11 @@ package pagerdutyapikey
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -39,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pandadoc/pandadoc.go b/pkg/detectors/pandadoc/pandadoc.go
index 2c5d76e10..14249c1b3 100644
--- a/pkg/detectors/pandadoc/pandadoc.go
+++ b/pkg/detectors/pandadoc/pandadoc.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pandascore/pandascore.go b/pkg/detectors/pandascore/pandascore.go
index 64f40812e..aa37413b9 100644
--- a/pkg/detectors/pandascore/pandascore.go
+++ b/pkg/detectors/pandascore/pandascore.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/paperform/paperform.go b/pkg/detectors/paperform/paperform.go
index a069c3de0..269c49619 100644
--- a/pkg/detectors/paperform/paperform.go
+++ b/pkg/detectors/paperform/paperform.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/paralleldots/paralleldots.go b/pkg/detectors/paralleldots/paralleldots.go
index 94cfeee56..efd45ecb4 100644
--- a/pkg/detectors/paralleldots/paralleldots.go
+++ b/pkg/detectors/paralleldots/paralleldots.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/parsehub/parsehub.go b/pkg/detectors/parsehub/parsehub.go
index 2bc66ff47..85ea5e82b 100644
--- a/pkg/detectors/parsehub/parsehub.go
+++ b/pkg/detectors/parsehub/parsehub.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/parsers/parsers.go b/pkg/detectors/parsers/parsers.go
index 58439f852..514ecfe48 100644
--- a/pkg/detectors/parsers/parsers.go
+++ b/pkg/detectors/parsers/parsers.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/parseur/parseur.go b/pkg/detectors/parseur/parseur.go
index 44f647b6f..1f9ac3ffe 100644
--- a/pkg/detectors/parseur/parseur.go
+++ b/pkg/detectors/parseur/parseur.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/partnerstack/partnerstack.go b/pkg/detectors/partnerstack/partnerstack.go
index 64d5bc335..5cbee8fb2 100644
--- a/pkg/detectors/partnerstack/partnerstack.go
+++ b/pkg/detectors/partnerstack/partnerstack.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pastebin/pastebin.go b/pkg/detectors/pastebin/pastebin.go
index 29b79a9de..50a98c300 100644
--- a/pkg/detectors/pastebin/pastebin.go
+++ b/pkg/detectors/pastebin/pastebin.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/paydirtapp/paydirtapp.go b/pkg/detectors/paydirtapp/paydirtapp.go
index dbdaf759d..c25bab4b3 100644
--- a/pkg/detectors/paydirtapp/paydirtapp.go
+++ b/pkg/detectors/paydirtapp/paydirtapp.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/paymoapp/paymoapp.go b/pkg/detectors/paymoapp/paymoapp.go
index b52b3ef13..5f5d18de1 100644
--- a/pkg/detectors/paymoapp/paymoapp.go
+++ b/pkg/detectors/paymoapp/paymoapp.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/paymongo/paymongo.go b/pkg/detectors/paymongo/paymongo.go
index 40c165bbc..aacf74cd7 100644
--- a/pkg/detectors/paymongo/paymongo.go
+++ b/pkg/detectors/paymongo/paymongo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/paypaloauth/paypaloauth.go b/pkg/detectors/paypaloauth/paypaloauth.go
index 9fcc2c971..6b2dfb07f 100644
--- a/pkg/detectors/paypaloauth/paypaloauth.go
+++ b/pkg/detectors/paypaloauth/paypaloauth.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, idMatch := range idmatches {
- if len(idMatch) != 2 {
- continue
- }
resIDMatch := strings.TrimSpace(idMatch[1])
for _, secretMatch := range matches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/paystack/paystack.go b/pkg/detectors/paystack/paystack.go
index 0cb169919..8814f9505 100644
--- a/pkg/detectors/paystack/paystack.go
+++ b/pkg/detectors/paystack/paystack.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pdflayer/pdflayer.go b/pkg/detectors/pdflayer/pdflayer.go
index c1fd82035..c20cf4af3 100644
--- a/pkg/detectors/pdflayer/pdflayer.go
+++ b/pkg/detectors/pdflayer/pdflayer.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pdfshift/pdfshift.go b/pkg/detectors/pdfshift/pdfshift.go
index c2345866a..d08c3b21b 100644
--- a/pkg/detectors/pdfshift/pdfshift.go
+++ b/pkg/detectors/pdfshift/pdfshift.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/peopledatalabs/peopledatalabs.go b/pkg/detectors/peopledatalabs/peopledatalabs.go
index a14655fb7..83a276d99 100644
--- a/pkg/detectors/peopledatalabs/peopledatalabs.go
+++ b/pkg/detectors/peopledatalabs/peopledatalabs.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pepipost/pepipost.go b/pkg/detectors/pepipost/pepipost.go
index 767dabc0c..1e3ac1cbf 100644
--- a/pkg/detectors/pepipost/pepipost.go
+++ b/pkg/detectors/pepipost/pepipost.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/percy/percy.go b/pkg/detectors/percy/percy.go
index 6a74eb373..64bece6f2 100644
--- a/pkg/detectors/percy/percy.go
+++ b/pkg/detectors/percy/percy.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pinata/pinata.go b/pkg/detectors/pinata/pinata.go
index 3b0499747..13626b250 100644
--- a/pkg/detectors/pinata/pinata.go
+++ b/pkg/detectors/pinata/pinata.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pipedream/pipedream.go b/pkg/detectors/pipedream/pipedream.go
index 78a242547..bfe8183d8 100644
--- a/pkg/detectors/pipedream/pipedream.go
+++ b/pkg/detectors/pipedream/pipedream.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pipedrive/pipedrive.go b/pkg/detectors/pipedrive/pipedrive.go
index 62f21831a..8db75fdaa 100644
--- a/pkg/detectors/pipedrive/pipedrive.go
+++ b/pkg/detectors/pipedrive/pipedrive.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pivotaltracker/pivotaltracker.go b/pkg/detectors/pivotaltracker/pivotaltracker.go
index 3bd95259c..bbb139277 100644
--- a/pkg/detectors/pivotaltracker/pivotaltracker.go
+++ b/pkg/detectors/pivotaltracker/pivotaltracker.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for _, match := range matches {
// First match is entire regex, second is the first group.
- if len(match) != 2 {
- continue
- }
token := match[1]
diff --git a/pkg/detectors/pixabay/pixabay.go b/pkg/detectors/pixabay/pixabay.go
index bc4f863f4..862b139b3 100644
--- a/pkg/detectors/pixabay/pixabay.go
+++ b/pkg/detectors/pixabay/pixabay.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/plaidkey/plaidkey.go b/pkg/detectors/plaidkey/plaidkey.go
index 4d1e9c305..6900a1de4 100644
--- a/pkg/detectors/plaidkey/plaidkey.go
+++ b/pkg/detectors/plaidkey/plaidkey.go
@@ -60,22 +60,19 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
for key := range uniqueKeys {
- resMatch := strings.TrimSpace(key)
-
for id := range uniqueIds {
- idresMatch := strings.TrimSpace(id)
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_PlaidKey,
- Raw: []byte(resMatch),
+ Raw: []byte(key),
}
environments := []string{"sandbox", "production"}
if verify {
for _, env := range environments {
- isVerified, _, verificationErr := verifyMatch(ctx, client, idresMatch, resMatch, env)
+ isVerified, _, verificationErr := verifyMatch(ctx, client, id, key, env)
s1.Verified = isVerified
s1.ExtraData = map[string]string{"environment": fmt.Sprintf("https://%s.plaid.com", env)}
- s1.SetVerificationError(verificationErr, idresMatch, resMatch)
+ s1.SetVerificationError(verificationErr, id, key)
}
results = append(results, s1)
// if the environment is sandbox, we don't need to check production
diff --git a/pkg/detectors/planviewleankit/planviewleankit.go b/pkg/detectors/planviewleankit/planviewleankit.go
index 2d9466c38..53bde8c85 100644
--- a/pkg/detectors/planviewleankit/planviewleankit.go
+++ b/pkg/detectors/planviewleankit/planviewleankit.go
@@ -12,7 +12,7 @@ import (
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
)
-type Scanner struct{
+type Scanner struct {
detectors.DefaultMultiPartCredentialProvider
}
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
subdomainMatches := subDomainPat.FindAllStringSubmatch(dataStr, -1)
for _, subdomainMatch := range subdomainMatches {
- if len(subdomainMatch) != 2 {
- continue
- }
resSubdomainMatch := strings.TrimSpace(subdomainMatch[1])
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/planyo/planyo.go b/pkg/detectors/planyo/planyo.go
index a89902118..6b1854115 100644
--- a/pkg/detectors/planyo/planyo.go
+++ b/pkg/detectors/planyo/planyo.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/plivo/plivo.go b/pkg/detectors/plivo/plivo.go
index 7810f214a..495279075 100644
--- a/pkg/detectors/plivo/plivo.go
+++ b/pkg/detectors/plivo/plivo.go
@@ -40,14 +40,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
id := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/podio/podio.go b/pkg/detectors/podio/podio.go
index 1e16e7b99..e57ccf87f 100644
--- a/pkg/detectors/podio/podio.go
+++ b/pkg/detectors/podio/podio.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pollsapi/pollsapi.go b/pkg/detectors/pollsapi/pollsapi.go
index 9fde442f5..3b336eead 100644
--- a/pkg/detectors/pollsapi/pollsapi.go
+++ b/pkg/detectors/pollsapi/pollsapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/poloniex/poloniex.go b/pkg/detectors/poloniex/poloniex.go
index b157391f1..d485627e0 100644
--- a/pkg/detectors/poloniex/poloniex.go
+++ b/pkg/detectors/poloniex/poloniex.go
@@ -46,15 +46,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/polygon/polygon.go b/pkg/detectors/polygon/polygon.go
index 34d6e8dc4..bdf88a349 100644
--- a/pkg/detectors/polygon/polygon.go
+++ b/pkg/detectors/polygon/polygon.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/portainer/portainer.go b/pkg/detectors/portainer/portainer.go
index 8cb20a5f7..47f132854 100644
--- a/pkg/detectors/portainer/portainer.go
+++ b/pkg/detectors/portainer/portainer.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
endpointMatches := endpointPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, endpointMatch := range endpointMatches {
diff --git a/pkg/detectors/portainertoken/portainertoken.go b/pkg/detectors/portainertoken/portainertoken.go
index 0f0c6fec3..fd02c0714 100644
--- a/pkg/detectors/portainertoken/portainertoken.go
+++ b/pkg/detectors/portainertoken/portainertoken.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
endpointMatches := endpointPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, endpointMatch := range endpointMatches {
diff --git a/pkg/detectors/positionstack/positionstack.go b/pkg/detectors/positionstack/positionstack.go
index 3482c3624..831c2ba73 100644
--- a/pkg/detectors/positionstack/positionstack.go
+++ b/pkg/detectors/positionstack/positionstack.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/postageapp/postageapp.go b/pkg/detectors/postageapp/postageapp.go
index cf0e7fce3..c6908cb16 100644
--- a/pkg/detectors/postageapp/postageapp.go
+++ b/pkg/detectors/postageapp/postageapp.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/postbacks/postbacks.go b/pkg/detectors/postbacks/postbacks.go
index e2b127553..9e6a961e6 100644
--- a/pkg/detectors/postbacks/postbacks.go
+++ b/pkg/detectors/postbacks/postbacks.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/posthog/posthog.go b/pkg/detectors/posthog/posthog.go
index f5a524539..a26c350a1 100644
--- a/pkg/detectors/posthog/posthog.go
+++ b/pkg/detectors/posthog/posthog.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/postman/postman.go b/pkg/detectors/postman/postman.go
index ad05155d5..f725ffb07 100644
--- a/pkg/detectors/postman/postman.go
+++ b/pkg/detectors/postman/postman.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/postmark/postmark.go b/pkg/detectors/postmark/postmark.go
index ebca6d524..333855d12 100644
--- a/pkg/detectors/postmark/postmark.go
+++ b/pkg/detectors/postmark/postmark.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/powrbot/powrbot.go b/pkg/detectors/powrbot/powrbot.go
index 9f83d40e9..fbfa6f29e 100644
--- a/pkg/detectors/powrbot/powrbot.go
+++ b/pkg/detectors/powrbot/powrbot.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/prefect/prefect.go b/pkg/detectors/prefect/prefect.go
index 4c4433de3..b135f163d 100644
--- a/pkg/detectors/prefect/prefect.go
+++ b/pkg/detectors/prefect/prefect.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/privacy/privacy.go b/pkg/detectors/privacy/privacy.go
index 58d4934af..30a73016a 100644
--- a/pkg/detectors/privacy/privacy.go
+++ b/pkg/detectors/privacy/privacy.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/prodpad/prodpad.go b/pkg/detectors/prodpad/prodpad.go
index 38b451b81..b6e926e3c 100644
--- a/pkg/detectors/prodpad/prodpad.go
+++ b/pkg/detectors/prodpad/prodpad.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/prospectcrm/prospectcrm.go b/pkg/detectors/prospectcrm/prospectcrm.go
index 5b2605559..b26b99129 100644
--- a/pkg/detectors/prospectcrm/prospectcrm.go
+++ b/pkg/detectors/prospectcrm/prospectcrm.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/protocolsio/protocolsio.go b/pkg/detectors/protocolsio/protocolsio.go
index 5d7d306ed..abc82e830 100644
--- a/pkg/detectors/protocolsio/protocolsio.go
+++ b/pkg/detectors/protocolsio/protocolsio.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/proxycrawl/proxycrawl.go b/pkg/detectors/proxycrawl/proxycrawl.go
index ccbc21a81..05a41820c 100644
--- a/pkg/detectors/proxycrawl/proxycrawl.go
+++ b/pkg/detectors/proxycrawl/proxycrawl.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go b/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go
index 3488509e9..77c36c8d7 100644
--- a/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go
+++ b/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go
@@ -3,10 +3,11 @@ package pubnubpublishkey
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -42,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
subMatches := subPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, subMatch := range subMatches {
- if len(subMatch) != 2 {
- continue
- }
ressubMatch := strings.TrimSpace(subMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go b/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go
index 510eb236e..b551a253e 100644
--- a/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go
+++ b/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go
@@ -2,10 +2,11 @@ package pubnubsubscriptionkey
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pulumi/pulumi.go b/pkg/detectors/pulumi/pulumi.go
index 749b0357a..deb620979 100644
--- a/pkg/detectors/pulumi/pulumi.go
+++ b/pkg/detectors/pulumi/pulumi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/purestake/purestake.go b/pkg/detectors/purestake/purestake.go
index e09ad3b24..027cb060e 100644
--- a/pkg/detectors/purestake/purestake.go
+++ b/pkg/detectors/purestake/purestake.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/pushbulletapikey/pushbulletapikey.go b/pkg/detectors/pushbulletapikey/pushbulletapikey.go
index acdc038c6..2eefea4b4 100644
--- a/pkg/detectors/pushbulletapikey/pushbulletapikey.go
+++ b/pkg/detectors/pushbulletapikey/pushbulletapikey.go
@@ -2,10 +2,11 @@ package pushbulletapikey
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/qase/qase.go b/pkg/detectors/qase/qase.go
index 97302120b..504dab912 100644
--- a/pkg/detectors/qase/qase.go
+++ b/pkg/detectors/qase/qase.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/qualaroo/qualaroo.go b/pkg/detectors/qualaroo/qualaroo.go
index 6ed98e200..7e1ed9fe5 100644
--- a/pkg/detectors/qualaroo/qualaroo.go
+++ b/pkg/detectors/qualaroo/qualaroo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/qubole/qubole.go b/pkg/detectors/qubole/qubole.go
index 579a32ba7..347bfb58b 100644
--- a/pkg/detectors/qubole/qubole.go
+++ b/pkg/detectors/qubole/qubole.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ramp/ramp.go b/pkg/detectors/ramp/ramp.go
index 0b6e14f6d..204e602a1 100644
--- a/pkg/detectors/ramp/ramp.go
+++ b/pkg/detectors/ramp/ramp.go
@@ -3,11 +3,12 @@ package ramp
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"net/url"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -42,16 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
-
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
diff --git a/pkg/detectors/rapidapi/rapidapi.go b/pkg/detectors/rapidapi/rapidapi.go
index 263fc5c95..b177aa991 100644
--- a/pkg/detectors/rapidapi/rapidapi.go
+++ b/pkg/detectors/rapidapi/rapidapi.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/raven/raven.go b/pkg/detectors/raven/raven.go
index 3f338195b..097ff6065 100644
--- a/pkg/detectors/raven/raven.go
+++ b/pkg/detectors/raven/raven.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/rawg/rawg.go b/pkg/detectors/rawg/rawg.go
index 7a87244ed..a1db9bb68 100644
--- a/pkg/detectors/rawg/rawg.go
+++ b/pkg/detectors/rawg/rawg.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/reachmail/reachmail.go b/pkg/detectors/reachmail/reachmail.go
index 363f4fed9..e1a3a3c25 100644
--- a/pkg/detectors/reachmail/reachmail.go
+++ b/pkg/detectors/reachmail/reachmail.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/readme/readme.go b/pkg/detectors/readme/readme.go
index 2921fb9df..9398b6fea 100644
--- a/pkg/detectors/readme/readme.go
+++ b/pkg/detectors/readme/readme.go
@@ -33,9 +33,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/reallysimplesystems/reallysimplesystems.go b/pkg/detectors/reallysimplesystems/reallysimplesystems.go
index ffecc18bd..e3ca78dcf 100644
--- a/pkg/detectors/reallysimplesystems/reallysimplesystems.go
+++ b/pkg/detectors/reallysimplesystems/reallysimplesystems.go
@@ -4,11 +4,12 @@ import (
"context"
"encoding/json"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"io"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -39,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/rebrandly/rebrandly.go b/pkg/detectors/rebrandly/rebrandly.go
index 50b69fb06..e83d4bb14 100644
--- a/pkg/detectors/rebrandly/rebrandly.go
+++ b/pkg/detectors/rebrandly/rebrandly.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/refiner/refiner.go b/pkg/detectors/refiner/refiner.go
index 8f970f196..54e787925 100644
--- a/pkg/detectors/refiner/refiner.go
+++ b/pkg/detectors/refiner/refiner.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/rentman/rentman.go b/pkg/detectors/rentman/rentman.go
index 3e9bb9ce9..8cbec01af 100644
--- a/pkg/detectors/rentman/rentman.go
+++ b/pkg/detectors/rentman/rentman.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/repairshopr/repairshopr.go b/pkg/detectors/repairshopr/repairshopr.go
index 7d1f8987d..1dbebbb08 100644
--- a/pkg/detectors/repairshopr/repairshopr.go
+++ b/pkg/detectors/repairshopr/repairshopr.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, domainmatch := range domainMatches {
- if len(domainmatch) != 2 {
- continue
- }
resDomainMatch := strings.TrimSpace(domainmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Repairshopr,
diff --git a/pkg/detectors/replicate/replicate.go b/pkg/detectors/replicate/replicate.go
index 3291008ee..fe41a9c02 100644
--- a/pkg/detectors/replicate/replicate.go
+++ b/pkg/detectors/replicate/replicate.go
@@ -34,9 +34,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/replyio/replyio.go b/pkg/detectors/replyio/replyio.go
index 258a8c979..4275dabd9 100644
--- a/pkg/detectors/replyio/replyio.go
+++ b/pkg/detectors/replyio/replyio.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/requestfinance/requestfinance.go b/pkg/detectors/requestfinance/requestfinance.go
index 75ed12e4e..84db87a38 100644
--- a/pkg/detectors/requestfinance/requestfinance.go
+++ b/pkg/detectors/requestfinance/requestfinance.go
@@ -3,10 +3,11 @@ package requestfinance
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -37,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go b/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go
index 048adf066..ef11f4168 100644
--- a/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go
+++ b/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go
@@ -2,10 +2,11 @@ package restpackhtmltopdfapi
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go b/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go
index d79798c81..8ba1b84b2 100644
--- a/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go
+++ b/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go
@@ -2,10 +2,11 @@ package restpackscreenshotapi
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/rev/rev.go b/pkg/detectors/rev/rev.go
index 3d1370380..f227d6ec1 100644
--- a/pkg/detectors/rev/rev.go
+++ b/pkg/detectors/rev/rev.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
clientMatches := clientKeyPat.FindAllStringSubmatch(dataStr, -1)
for _, userMatch := range userMatches {
- if len(userMatch) != 2 {
- continue
- }
resUserMatch := strings.TrimSpace(userMatch[1])
for _, clientMatch := range clientMatches {
- if len(clientMatch) != 2 {
- continue
- }
resClientMatch := strings.TrimSpace(clientMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/revampcrm/revampcrm.go b/pkg/detectors/revampcrm/revampcrm.go
index 978be4e7e..9e318b1c7 100644
--- a/pkg/detectors/revampcrm/revampcrm.go
+++ b/pkg/detectors/revampcrm/revampcrm.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/ringcentral/ringcentral.go b/pkg/detectors/ringcentral/ringcentral.go
index 3406b0395..661a38eaa 100644
--- a/pkg/detectors/ringcentral/ringcentral.go
+++ b/pkg/detectors/ringcentral/ringcentral.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
uriMatches := uriPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, uriMatch := range uriMatches {
- if len(uriMatch) != 2 {
- continue
- }
resURI := strings.TrimSpace(uriMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_RingCentral,
diff --git a/pkg/detectors/ritekit/ritekit.go b/pkg/detectors/ritekit/ritekit.go
index 5539f5dae..68d6fecbb 100644
--- a/pkg/detectors/ritekit/ritekit.go
+++ b/pkg/detectors/ritekit/ritekit.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/roaring/roaring.go b/pkg/detectors/roaring/roaring.go
index 7ef410755..85457d47d 100644
--- a/pkg/detectors/roaring/roaring.go
+++ b/pkg/detectors/roaring/roaring.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, clientMatch := range clientMatches {
- if len(clientMatch) != 2 {
- continue
- }
resClient := strings.TrimSpace(clientMatch[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/rocketreach/rocketreach.go b/pkg/detectors/rocketreach/rocketreach.go
index f4dcb1fff..dea46e507 100644
--- a/pkg/detectors/rocketreach/rocketreach.go
+++ b/pkg/detectors/rocketreach/rocketreach.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/roninapp/roninapp.go b/pkg/detectors/roninapp/roninapp.go
index 6434ee451..a1f59bab2 100644
--- a/pkg/detectors/roninapp/roninapp.go
+++ b/pkg/detectors/roninapp/roninapp.go
@@ -43,15 +43,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_RoninApp,
diff --git a/pkg/detectors/route4me/route4me.go b/pkg/detectors/route4me/route4me.go
index f3866f85d..b424144af 100644
--- a/pkg/detectors/route4me/route4me.go
+++ b/pkg/detectors/route4me/route4me.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/rownd/rownd.go b/pkg/detectors/rownd/rownd.go
index 56e76a589..1f4d301b4 100644
--- a/pkg/detectors/rownd/rownd.go
+++ b/pkg/detectors/rownd/rownd.go
@@ -42,21 +42,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resId := strings.TrimSpace(idMatch[1])
for _, match := range keyMatches {
- if len(match) != 2 {
- continue
- }
keyMatch := strings.TrimSpace(match[1])
for _, secret := range secretMatches {
- if len(secret) != 2 {
- continue
- }
secretMatch := strings.TrimSpace(secret[1])
diff --git a/pkg/detectors/rubygems/rubygems.go b/pkg/detectors/rubygems/rubygems.go
index bd16c8ca6..89581110e 100644
--- a/pkg/detectors/rubygems/rubygems.go
+++ b/pkg/detectors/rubygems/rubygems.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/runrunit/runrunit.go b/pkg/detectors/runrunit/runrunit.go
index 0dd6c8d81..302fef0aa 100644
--- a/pkg/detectors/runrunit/runrunit.go
+++ b/pkg/detectors/runrunit/runrunit.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
userTokenMatches := userTokenPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, userTokenMatch := range userTokenMatches {
- if len(userTokenMatch) != 2 {
- continue
- }
resUserTokenMatch := strings.TrimSpace(userTokenMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/salesblink/salesblink.go b/pkg/detectors/salesblink/salesblink.go
index 3a2b7844c..c97f80470 100644
--- a/pkg/detectors/salesblink/salesblink.go
+++ b/pkg/detectors/salesblink/salesblink.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/salescookie/salescookie.go b/pkg/detectors/salescookie/salescookie.go
index 146b5f2ea..adb5cd2f8 100644
--- a/pkg/detectors/salescookie/salescookie.go
+++ b/pkg/detectors/salescookie/salescookie.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/salesflare/salesflare.go b/pkg/detectors/salesflare/salesflare.go
index 4cfe60278..c03c46289 100644
--- a/pkg/detectors/salesflare/salesflare.go
+++ b/pkg/detectors/salesflare/salesflare.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/salesforce/salesforce.go b/pkg/detectors/salesforce/salesforce.go
index 09b7ade92..c3478f9d0 100644
--- a/pkg/detectors/salesforce/salesforce.go
+++ b/pkg/detectors/salesforce/salesforce.go
@@ -46,16 +46,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
tokenMatches := accessTokenPat.FindAllStringSubmatch(dataStr, -1)
for _, instance := range instanceMatches {
- if len(instance) != 1 {
- continue
- }
instanceMatch := strings.TrimSpace(instance[0])
for _, token := range tokenMatches {
- if len(token) != 1 {
- continue
- }
tokenMatch := strings.TrimSpace(token[0])
diff --git a/pkg/detectors/salesmate/salesmate.go b/pkg/detectors/salesmate/salesmate.go
index b7d2ac758..5071af3d0 100644
--- a/pkg/detectors/salesmate/salesmate.go
+++ b/pkg/detectors/salesmate/salesmate.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Salesmate,
diff --git a/pkg/detectors/saucelabs/saucelabs.go b/pkg/detectors/saucelabs/saucelabs.go
index e8e968f74..4835c39da 100644
--- a/pkg/detectors/saucelabs/saucelabs.go
+++ b/pkg/detectors/saucelabs/saucelabs.go
@@ -83,7 +83,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
results = append(results, s1)
}
}
-
}
return results, nil
diff --git a/pkg/detectors/scalewaykey/scalewaykey.go b/pkg/detectors/scalewaykey/scalewaykey.go
index a2380b794..ccb5e9035 100644
--- a/pkg/detectors/scalewaykey/scalewaykey.go
+++ b/pkg/detectors/scalewaykey/scalewaykey.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/scalr/scalr.go b/pkg/detectors/scalr/scalr.go
index cc6a22f96..08c6eedcb 100644
--- a/pkg/detectors/scalr/scalr.go
+++ b/pkg/detectors/scalr/scalr.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Scalr,
diff --git a/pkg/detectors/scrapeowl/scrapeowl.go b/pkg/detectors/scrapeowl/scrapeowl.go
index ddc808825..58ad4f001 100644
--- a/pkg/detectors/scrapeowl/scrapeowl.go
+++ b/pkg/detectors/scrapeowl/scrapeowl.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/scraperapi/scraperapi.go b/pkg/detectors/scraperapi/scraperapi.go
index 8271e300b..68c2475e0 100644
--- a/pkg/detectors/scraperapi/scraperapi.go
+++ b/pkg/detectors/scraperapi/scraperapi.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
dataStr := string(data)
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/scraperbox/scraperbox.go b/pkg/detectors/scraperbox/scraperbox.go
index 636010d27..4b71f35f9 100644
--- a/pkg/detectors/scraperbox/scraperbox.go
+++ b/pkg/detectors/scraperbox/scraperbox.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/scrapestack/scrapestack.go b/pkg/detectors/scrapestack/scrapestack.go
index d099495bc..49345dcd7 100644
--- a/pkg/detectors/scrapestack/scrapestack.go
+++ b/pkg/detectors/scrapestack/scrapestack.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/scrapfly/scrapfly.go b/pkg/detectors/scrapfly/scrapfly.go
index d2d824e33..4f6c55386 100644
--- a/pkg/detectors/scrapfly/scrapfly.go
+++ b/pkg/detectors/scrapfly/scrapfly.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/scrapingant/scrapingant.go b/pkg/detectors/scrapingant/scrapingant.go
index 3c14c9c6e..0faa0985a 100644
--- a/pkg/detectors/scrapingant/scrapingant.go
+++ b/pkg/detectors/scrapingant/scrapingant.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/screenshotapi/screenshotapi.go b/pkg/detectors/screenshotapi/screenshotapi.go
index 542d26bb7..552d407d3 100644
--- a/pkg/detectors/screenshotapi/screenshotapi.go
+++ b/pkg/detectors/screenshotapi/screenshotapi.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/screenshotlayer/screenshotlayer.go b/pkg/detectors/screenshotlayer/screenshotlayer.go
index 1d782f852..59b462324 100644
--- a/pkg/detectors/screenshotlayer/screenshotlayer.go
+++ b/pkg/detectors/screenshotlayer/screenshotlayer.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/scrutinizerci/scrutinizerci.go b/pkg/detectors/scrutinizerci/scrutinizerci.go
index 4aa08d656..201db7b32 100644
--- a/pkg/detectors/scrutinizerci/scrutinizerci.go
+++ b/pkg/detectors/scrutinizerci/scrutinizerci.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/securitytrails/securitytrails.go b/pkg/detectors/securitytrails/securitytrails.go
index 0f12d47c1..10de81352 100644
--- a/pkg/detectors/securitytrails/securitytrails.go
+++ b/pkg/detectors/securitytrails/securitytrails.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/segmentapikey/segmentapikey.go b/pkg/detectors/segmentapikey/segmentapikey.go
index ac0ffb480..8513b85af 100644
--- a/pkg/detectors/segmentapikey/segmentapikey.go
+++ b/pkg/detectors/segmentapikey/segmentapikey.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/selectpdf/selectpdf.go b/pkg/detectors/selectpdf/selectpdf.go
index cc1b696dd..9167b8a27 100644
--- a/pkg/detectors/selectpdf/selectpdf.go
+++ b/pkg/detectors/selectpdf/selectpdf.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/semaphore/semaphore.go b/pkg/detectors/semaphore/semaphore.go
index f9e163e74..4c3557b7b 100644
--- a/pkg/detectors/semaphore/semaphore.go
+++ b/pkg/detectors/semaphore/semaphore.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
if !detectors.HasDigit(resMatch) {
diff --git a/pkg/detectors/sendbird/sendbird.go b/pkg/detectors/sendbird/sendbird.go
index 5e74457d1..190392353 100644
--- a/pkg/detectors/sendbird/sendbird.go
+++ b/pkg/detectors/sendbird/sendbird.go
@@ -47,15 +47,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
appIdMatches := appIdPat.FindAllStringSubmatch(dataStr, -1)
for _, appIdMatch := range appIdMatches {
- if len(appIdMatch) != 2 {
- continue
- }
resAppIdMatch := strings.TrimSpace(appIdMatch[1])
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sendbirdorganizationapi/sendbirdorganizationapi.go b/pkg/detectors/sendbirdorganizationapi/sendbirdorganizationapi.go
index c0cd91516..dff73d59c 100644
--- a/pkg/detectors/sendbirdorganizationapi/sendbirdorganizationapi.go
+++ b/pkg/detectors/sendbirdorganizationapi/sendbirdorganizationapi.go
@@ -3,10 +3,11 @@ package sendbirdorganizationapi
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -39,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sendinbluev2/sendinbluev2.go b/pkg/detectors/sendinbluev2/sendinbluev2.go
index 28b973363..96f68ca2e 100644
--- a/pkg/detectors/sendinbluev2/sendinbluev2.go
+++ b/pkg/detectors/sendinbluev2/sendinbluev2.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sentrytoken/sentrytoken.go b/pkg/detectors/sentrytoken/sentrytoken.go
index 2ee37c582..05d748a6a 100644
--- a/pkg/detectors/sentrytoken/sentrytoken.go
+++ b/pkg/detectors/sentrytoken/sentrytoken.go
@@ -44,9 +44,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_SentryToken,
diff --git a/pkg/detectors/serphouse/serphouse.go b/pkg/detectors/serphouse/serphouse.go
index fbec88e72..051f77be6 100644
--- a/pkg/detectors/serphouse/serphouse.go
+++ b/pkg/detectors/serphouse/serphouse.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/serpstack/serpstack.go b/pkg/detectors/serpstack/serpstack.go
index b7b660bec..8512ebba7 100644
--- a/pkg/detectors/serpstack/serpstack.go
+++ b/pkg/detectors/serpstack/serpstack.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sheety/sheety.go b/pkg/detectors/sheety/sheety.go
index ff7111bb8..eab7f70bb 100644
--- a/pkg/detectors/sheety/sheety.go
+++ b/pkg/detectors/sheety/sheety.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sherpadesk/sherpadesk.go b/pkg/detectors/sherpadesk/sherpadesk.go
index 5bc944f20..8acd88505 100644
--- a/pkg/detectors/sherpadesk/sherpadesk.go
+++ b/pkg/detectors/sherpadesk/sherpadesk.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/shipday/shipday.go b/pkg/detectors/shipday/shipday.go
index ed58c3ec3..e725bda5c 100644
--- a/pkg/detectors/shipday/shipday.go
+++ b/pkg/detectors/shipday/shipday.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/shodankey/shodankey.go b/pkg/detectors/shodankey/shodankey.go
index 3fbf8a145..f2edb21eb 100644
--- a/pkg/detectors/shodankey/shodankey.go
+++ b/pkg/detectors/shodankey/shodankey.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/shortcut/shortcut.go b/pkg/detectors/shortcut/shortcut.go
index 71716b9eb..a5f23bcab 100644
--- a/pkg/detectors/shortcut/shortcut.go
+++ b/pkg/detectors/shortcut/shortcut.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/shotstack/shotstack.go b/pkg/detectors/shotstack/shotstack.go
index 54cbf5558..fe0c0e6d5 100644
--- a/pkg/detectors/shotstack/shotstack.go
+++ b/pkg/detectors/shotstack/shotstack.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/shutterstock/shutterstock.go b/pkg/detectors/shutterstock/shutterstock.go
index 876723ec8..0b2522038 100644
--- a/pkg/detectors/shutterstock/shutterstock.go
+++ b/pkg/detectors/shutterstock/shutterstock.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/shutterstockoauth/shutterstockoauth.go b/pkg/detectors/shutterstockoauth/shutterstockoauth.go
index 39c77b157..c1eb8a2ea 100644
--- a/pkg/detectors/shutterstockoauth/shutterstockoauth.go
+++ b/pkg/detectors/shutterstockoauth/shutterstockoauth.go
@@ -3,10 +3,11 @@ package shutterstockoauth
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -37,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/signable/signable.go b/pkg/detectors/signable/signable.go
index 41b6a491d..3eedbcba2 100644
--- a/pkg/detectors/signable/signable.go
+++ b/pkg/detectors/signable/signable.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := tokenPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
if isCommonFalsePositive(match[0]) {
continue
diff --git a/pkg/detectors/signalwire/signalwire.go b/pkg/detectors/signalwire/signalwire.go
index 6f13c554c..85ee2b9cc 100644
--- a/pkg/detectors/signalwire/signalwire.go
+++ b/pkg/detectors/signalwire/signalwire.go
@@ -44,21 +44,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
urlMatches := urlPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resID := strings.TrimSpace(idMatch[1])
for _, urlMatch := range urlMatches {
- if len(urlMatch) != 2 {
- continue
- }
resURL := strings.TrimSpace(urlMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/signaturit/signaturit.go b/pkg/detectors/signaturit/signaturit.go
index 16eaa5456..d71657a3b 100644
--- a/pkg/detectors/signaturit/signaturit.go
+++ b/pkg/detectors/signaturit/signaturit.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/signupgenius/signupgenius.go b/pkg/detectors/signupgenius/signupgenius.go
index a90013124..548d46e9f 100644
--- a/pkg/detectors/signupgenius/signupgenius.go
+++ b/pkg/detectors/signupgenius/signupgenius.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sigopt/sigopt.go b/pkg/detectors/sigopt/sigopt.go
index efac2fa00..e24ea8678 100644
--- a/pkg/detectors/sigopt/sigopt.go
+++ b/pkg/detectors/sigopt/sigopt.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/simfin/simfin.go b/pkg/detectors/simfin/simfin.go
index f21781c31..e356197a8 100644
--- a/pkg/detectors/simfin/simfin.go
+++ b/pkg/detectors/simfin/simfin.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/simplesat/simplesat.go b/pkg/detectors/simplesat/simplesat.go
index 31bbe9264..83418e2c7 100644
--- a/pkg/detectors/simplesat/simplesat.go
+++ b/pkg/detectors/simplesat/simplesat.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/simplynoted/simplynoted.go b/pkg/detectors/simplynoted/simplynoted.go
index 3209e0a26..ecbb98e1e 100644
--- a/pkg/detectors/simplynoted/simplynoted.go
+++ b/pkg/detectors/simplynoted/simplynoted.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/simvoly/simvoly.go b/pkg/detectors/simvoly/simvoly.go
index 2b11db84a..12936e589 100644
--- a/pkg/detectors/simvoly/simvoly.go
+++ b/pkg/detectors/simvoly/simvoly.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sinchmessage/sinchmessage.go b/pkg/detectors/sinchmessage/sinchmessage.go
index 1a8a8c5b6..5d21481cc 100644
--- a/pkg/detectors/sinchmessage/sinchmessage.go
+++ b/pkg/detectors/sinchmessage/sinchmessage.go
@@ -41,14 +41,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sirv/sirv.go b/pkg/detectors/sirv/sirv.go
index cbce3055f..0f80dd963 100644
--- a/pkg/detectors/sirv/sirv.go
+++ b/pkg/detectors/sirv/sirv.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/siteleaf/siteleaf.go b/pkg/detectors/siteleaf/siteleaf.go
index 54a16dbba..707118bdd 100644
--- a/pkg/detectors/siteleaf/siteleaf.go
+++ b/pkg/detectors/siteleaf/siteleaf.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/skrappio/skrappio.go b/pkg/detectors/skrappio/skrappio.go
index 860f59e21..4e26a8909 100644
--- a/pkg/detectors/skrappio/skrappio.go
+++ b/pkg/detectors/skrappio/skrappio.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/slackwebhook/slackwebhook.go b/pkg/detectors/slackwebhook/slackwebhook.go
index f77551cf3..e151f4a9c 100644
--- a/pkg/detectors/slackwebhook/slackwebhook.go
+++ b/pkg/detectors/slackwebhook/slackwebhook.go
@@ -45,9 +45,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/smartsheets/smartsheets.go b/pkg/detectors/smartsheets/smartsheets.go
index 35eb0fefb..228352745 100644
--- a/pkg/detectors/smartsheets/smartsheets.go
+++ b/pkg/detectors/smartsheets/smartsheets.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/smartystreets/smartystreets.go b/pkg/detectors/smartystreets/smartystreets.go
index bad51ab95..df4f0ff90 100644
--- a/pkg/detectors/smartystreets/smartystreets.go
+++ b/pkg/detectors/smartystreets/smartystreets.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/smooch/smooch.go b/pkg/detectors/smooch/smooch.go
index fdc34a001..e825f5b02 100644
--- a/pkg/detectors/smooch/smooch.go
+++ b/pkg/detectors/smooch/smooch.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/snipcart/snipcart.go b/pkg/detectors/snipcart/snipcart.go
index 1631df606..2dd9f0bdc 100644
--- a/pkg/detectors/snipcart/snipcart.go
+++ b/pkg/detectors/snipcart/snipcart.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sonarcloud/sonarcloud.go b/pkg/detectors/sonarcloud/sonarcloud.go
index 244fb81f9..0cebf3664 100644
--- a/pkg/detectors/sonarcloud/sonarcloud.go
+++ b/pkg/detectors/sonarcloud/sonarcloud.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sourcegraph/sourcegraph.go b/pkg/detectors/sourcegraph/sourcegraph.go
index a87e4bc78..93566d453 100644
--- a/pkg/detectors/sourcegraph/sourcegraph.go
+++ b/pkg/detectors/sourcegraph/sourcegraph.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sourcegraphcody/sourcegraphcody.go b/pkg/detectors/sourcegraphcody/sourcegraphcody.go
index d39f53aa8..37aa58b14 100644
--- a/pkg/detectors/sourcegraphcody/sourcegraphcody.go
+++ b/pkg/detectors/sourcegraphcody/sourcegraphcody.go
@@ -3,10 +3,11 @@ package sourcegraphcody
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -38,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sparkpost/sparkpost.go b/pkg/detectors/sparkpost/sparkpost.go
index 7af471b0a..e73b0e0fc 100644
--- a/pkg/detectors/sparkpost/sparkpost.go
+++ b/pkg/detectors/sparkpost/sparkpost.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/speechtextai/speechtextai.go b/pkg/detectors/speechtextai/speechtextai.go
index bf1f46e82..bdb0c8dfa 100644
--- a/pkg/detectors/speechtextai/speechtextai.go
+++ b/pkg/detectors/speechtextai/speechtextai.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go b/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go
index d8114b5d4..0c9059792 100644
--- a/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go
+++ b/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go
@@ -2,10 +2,11 @@ package splunkobservabilitytoken
import (
"context"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
@@ -58,7 +56,7 @@ 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
- }
+ }
}
}
diff --git a/pkg/detectors/spoonacular/spoonacular.go b/pkg/detectors/spoonacular/spoonacular.go
index 8bc78219d..edb8a5b13 100644
--- a/pkg/detectors/spoonacular/spoonacular.go
+++ b/pkg/detectors/spoonacular/spoonacular.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sportsmonk/sportsmonk.go b/pkg/detectors/sportsmonk/sportsmonk.go
index a31de92c5..ebc1180c8 100644
--- a/pkg/detectors/sportsmonk/sportsmonk.go
+++ b/pkg/detectors/sportsmonk/sportsmonk.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/spotifykey/spotifykey.go b/pkg/detectors/spotifykey/spotifykey.go
index 89a769421..3b8bf03dc 100644
--- a/pkg/detectors/spotifykey/spotifykey.go
+++ b/pkg/detectors/spotifykey/spotifykey.go
@@ -44,14 +44,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
idresMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_SpotifyKey,
diff --git a/pkg/detectors/square/square.go b/pkg/detectors/square/square.go
index 9ac654291..94052a7f2 100644
--- a/pkg/detectors/square/square.go
+++ b/pkg/detectors/square/square.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secMatches := secretPat.FindAllStringSubmatch(dataStr, -1)
for _, secMatch := range secMatches {
- if len(secMatch) != 2 {
- continue
- }
resMatch := strings.TrimSpace(secMatch[1])
result := detectors.Result{
diff --git a/pkg/detectors/squarespace/squarespace.go b/pkg/detectors/squarespace/squarespace.go
index 9a58387a3..1398fb30e 100644
--- a/pkg/detectors/squarespace/squarespace.go
+++ b/pkg/detectors/squarespace/squarespace.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/squareup/squareup.go b/pkg/detectors/squareup/squareup.go
index eee3b341c..bfa2a5ac4 100644
--- a/pkg/detectors/squareup/squareup.go
+++ b/pkg/detectors/squareup/squareup.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sslmate/sslmate.go b/pkg/detectors/sslmate/sslmate.go
index efcc318a5..29d302362 100644
--- a/pkg/detectors/sslmate/sslmate.go
+++ b/pkg/detectors/sslmate/sslmate.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/statuscake/statuscake.go b/pkg/detectors/statuscake/statuscake.go
index b154c8db2..e06b3a42a 100644
--- a/pkg/detectors/statuscake/statuscake.go
+++ b/pkg/detectors/statuscake/statuscake.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/statuspage/statuspage.go b/pkg/detectors/statuspage/statuspage.go
index 58281ed10..c980c6973 100644
--- a/pkg/detectors/statuspage/statuspage.go
+++ b/pkg/detectors/statuspage/statuspage.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/statuspal/statuspal.go b/pkg/detectors/statuspal/statuspal.go
index daa496cd3..bdc7574b9 100644
--- a/pkg/detectors/statuspal/statuspal.go
+++ b/pkg/detectors/statuspal/statuspal.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/stitchdata/stitchdata.go b/pkg/detectors/stitchdata/stitchdata.go
index 106a0e7fa..44f33f2a2 100644
--- a/pkg/detectors/stitchdata/stitchdata.go
+++ b/pkg/detectors/stitchdata/stitchdata.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/stockdata/stockdata.go b/pkg/detectors/stockdata/stockdata.go
index 8108dcd1e..03c2f0732 100644
--- a/pkg/detectors/stockdata/stockdata.go
+++ b/pkg/detectors/stockdata/stockdata.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/storecove/storecove.go b/pkg/detectors/storecove/storecove.go
index f07f01320..de90b55e1 100644
--- a/pkg/detectors/storecove/storecove.go
+++ b/pkg/detectors/storecove/storecove.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/stormboard/stormboard.go b/pkg/detectors/stormboard/stormboard.go
index 33aa5dd77..b3cf0c582 100644
--- a/pkg/detectors/stormboard/stormboard.go
+++ b/pkg/detectors/stormboard/stormboard.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/stormglass/stormglass.go b/pkg/detectors/stormglass/stormglass.go
index d72b63a97..420d4be98 100644
--- a/pkg/detectors/stormglass/stormglass.go
+++ b/pkg/detectors/stormglass/stormglass.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/storyblok/storyblok.go b/pkg/detectors/storyblok/storyblok.go
index c88c8f4c2..29904dce0 100644
--- a/pkg/detectors/storyblok/storyblok.go
+++ b/pkg/detectors/storyblok/storyblok.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/storychief/storychief.go b/pkg/detectors/storychief/storychief.go
index e0ebc4d8d..36356fe4e 100644
--- a/pkg/detectors/storychief/storychief.go
+++ b/pkg/detectors/storychief/storychief.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/strava/strava.go b/pkg/detectors/strava/strava.go
index 8e4ff2331..523291d09 100644
--- a/pkg/detectors/strava/strava.go
+++ b/pkg/detectors/strava/strava.go
@@ -42,21 +42,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
keyMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range idMatches {
- if len(match) != 2 {
- continue
- }
resId := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
for _, keyMatch := range keyMatches {
- if len(keyMatch) != 2 {
- continue
- }
resKey := strings.TrimSpace(keyMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/streak/streak.go b/pkg/detectors/streak/streak.go
index 6b3c1fdfc..67cb5416a 100644
--- a/pkg/detectors/streak/streak.go
+++ b/pkg/detectors/streak/streak.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/stripo/stripo.go b/pkg/detectors/stripo/stripo.go
index a44a878b9..562a45b77 100644
--- a/pkg/detectors/stripo/stripo.go
+++ b/pkg/detectors/stripo/stripo.go
@@ -35,9 +35,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/stytch/stytch.go b/pkg/detectors/stytch/stytch.go
index 160d78cc3..3f237091d 100644
--- a/pkg/detectors/stytch/stytch.go
+++ b/pkg/detectors/stytch/stytch.go
@@ -39,15 +39,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/sugester/sugester.go b/pkg/detectors/sugester/sugester.go
index e3288db80..eec6e53ba 100644
--- a/pkg/detectors/sugester/sugester.go
+++ b/pkg/detectors/sugester/sugester.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, domainmatch := range domainMatches {
- if len(domainmatch) != 2 {
- continue
- }
resDomainMatch := strings.TrimSpace(domainmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Sugester,
diff --git a/pkg/detectors/supabasetoken/supabasetoken.go b/pkg/detectors/supabasetoken/supabasetoken.go
index b45614b64..d904f4e00 100644
--- a/pkg/detectors/supabasetoken/supabasetoken.go
+++ b/pkg/detectors/supabasetoken/supabasetoken.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/supernotesapi/supernotesapi.go b/pkg/detectors/supernotesapi/supernotesapi.go
index 1fec9bec4..f10020095 100644
--- a/pkg/detectors/supernotesapi/supernotesapi.go
+++ b/pkg/detectors/supernotesapi/supernotesapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/surveyanyplace/surveyanyplace.go b/pkg/detectors/surveyanyplace/surveyanyplace.go
index 17d3bf88b..6f315b5a1 100644
--- a/pkg/detectors/surveyanyplace/surveyanyplace.go
+++ b/pkg/detectors/surveyanyplace/surveyanyplace.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/surveybot/surveybot.go b/pkg/detectors/surveybot/surveybot.go
index 20d930101..27eddefd0 100644
--- a/pkg/detectors/surveybot/surveybot.go
+++ b/pkg/detectors/surveybot/surveybot.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/surveysparrow/surveysparrow.go b/pkg/detectors/surveysparrow/surveysparrow.go
index 9886c8119..436e1cefa 100644
--- a/pkg/detectors/surveysparrow/surveysparrow.go
+++ b/pkg/detectors/surveysparrow/surveysparrow.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/survicate/survicate.go b/pkg/detectors/survicate/survicate.go
index 640612f79..0dae1e6fc 100644
--- a/pkg/detectors/survicate/survicate.go
+++ b/pkg/detectors/survicate/survicate.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/swell/swell.go b/pkg/detectors/swell/swell.go
index 8d3673c57..de4147218 100644
--- a/pkg/detectors/swell/swell.go
+++ b/pkg/detectors/swell/swell.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(idMatch[1])
diff --git a/pkg/detectors/swiftype/swiftype.go b/pkg/detectors/swiftype/swiftype.go
index 21d0af96e..f3cc5a678 100644
--- a/pkg/detectors/swiftype/swiftype.go
+++ b/pkg/detectors/swiftype/swiftype.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tallyfy/tallyfy.go b/pkg/detectors/tallyfy/tallyfy.go
index 94960eb9d..d2e4c687d 100644
--- a/pkg/detectors/tallyfy/tallyfy.go
+++ b/pkg/detectors/tallyfy/tallyfy.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tatumio/tatumio.go b/pkg/detectors/tatumio/tatumio.go
index cf6c50f26..31930b3e6 100644
--- a/pkg/detectors/tatumio/tatumio.go
+++ b/pkg/detectors/tatumio/tatumio.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/taxjar/taxjar.go b/pkg/detectors/taxjar/taxjar.go
index 82064f039..5dc44105a 100644
--- a/pkg/detectors/taxjar/taxjar.go
+++ b/pkg/detectors/taxjar/taxjar.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/teamgate/teamgate.go b/pkg/detectors/teamgate/teamgate.go
index 4e136024f..b8793411e 100644
--- a/pkg/detectors/teamgate/teamgate.go
+++ b/pkg/detectors/teamgate/teamgate.go
@@ -39,15 +39,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
keyMatches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, keyMatch := range keyMatches {
- if len(keyMatch) != 2 {
- continue
- }
resKeyMatch := strings.TrimSpace(keyMatch[1])
diff --git a/pkg/detectors/teamworkcrm/teamworkcrm.go b/pkg/detectors/teamworkcrm/teamworkcrm.go
index f941a4225..9df53b0bf 100644
--- a/pkg/detectors/teamworkcrm/teamworkcrm.go
+++ b/pkg/detectors/teamworkcrm/teamworkcrm.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/teamworkdesk/teamworkdesk.go b/pkg/detectors/teamworkdesk/teamworkdesk.go
index 8877f987a..cae2900bb 100644
--- a/pkg/detectors/teamworkdesk/teamworkdesk.go
+++ b/pkg/detectors/teamworkdesk/teamworkdesk.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/teamworkspaces/teamworkspaces.go b/pkg/detectors/teamworkspaces/teamworkspaces.go
index 85c11f820..d6010582c 100644
--- a/pkg/detectors/teamworkspaces/teamworkspaces.go
+++ b/pkg/detectors/teamworkspaces/teamworkspaces.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go b/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go
index 35b6893e5..5059f9bb6 100644
--- a/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go
+++ b/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tefter/tefter.go b/pkg/detectors/tefter/tefter.go
index 212f556a5..bfbea4e53 100644
--- a/pkg/detectors/tefter/tefter.go
+++ b/pkg/detectors/tefter/tefter.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/telegrambottoken/telegrambottoken.go b/pkg/detectors/telegrambottoken/telegrambottoken.go
index 7b82327b8..3f9e2007b 100644
--- a/pkg/detectors/telegrambottoken/telegrambottoken.go
+++ b/pkg/detectors/telegrambottoken/telegrambottoken.go
@@ -4,11 +4,12 @@ import (
"context"
"encoding/json"
- // "fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ // "fmt"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -42,9 +43,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
key := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/teletype/teletype.go b/pkg/detectors/teletype/teletype.go
index 02fbaccfe..a939fe8a6 100644
--- a/pkg/detectors/teletype/teletype.go
+++ b/pkg/detectors/teletype/teletype.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/telnyx/telnyx.go b/pkg/detectors/telnyx/telnyx.go
index a2c613ab6..6d56ee1ee 100644
--- a/pkg/detectors/telnyx/telnyx.go
+++ b/pkg/detectors/telnyx/telnyx.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go b/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go
index c69ac6ef0..fe71f1999 100644
--- a/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go
+++ b/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go
@@ -3,10 +3,11 @@ package terraformcloudpersonaltoken
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -36,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/textmagic/textmagic.go b/pkg/detectors/textmagic/textmagic.go
index 337a10dae..d1a4ef054 100644
--- a/pkg/detectors/textmagic/textmagic.go
+++ b/pkg/detectors/textmagic/textmagic.go
@@ -13,7 +13,7 @@ import (
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
)
-type Scanner struct{
+type Scanner struct {
detectors.DefaultMultiPartCredentialProvider
}
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
userMatches := userPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, userMatch := range userMatches {
- if len(userMatch) != 2 {
- continue
- }
resUser := strings.TrimSpace(userMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/theoddsapi/theoddsapi.go b/pkg/detectors/theoddsapi/theoddsapi.go
index 269a51076..4be4baf30 100644
--- a/pkg/detectors/theoddsapi/theoddsapi.go
+++ b/pkg/detectors/theoddsapi/theoddsapi.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/thinkific/thinkific.go b/pkg/detectors/thinkific/thinkific.go
index 5cb43c985..91ddaea61 100644
--- a/pkg/detectors/thinkific/thinkific.go
+++ b/pkg/detectors/thinkific/thinkific.go
@@ -42,15 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
domainMatches := domainPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, domainMatch := range domainMatches {
-
- if len(domainMatch) != 2 {
- continue
- }
resDomainMatch := strings.TrimSpace(domainMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Thinkific,
diff --git a/pkg/detectors/thousandeyes/thousandeyes.go b/pkg/detectors/thousandeyes/thousandeyes.go
index 0fa225463..735905b45 100644
--- a/pkg/detectors/thousandeyes/thousandeyes.go
+++ b/pkg/detectors/thousandeyes/thousandeyes.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
emailMatches := email.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
tokenPatMatch := strings.TrimSpace(match[1])
for _, emailMatch := range emailMatches {
- if len(emailMatch) != 2 {
- continue
- }
userPatMatch := strings.TrimSpace(emailMatch[1])
diff --git a/pkg/detectors/ticketmaster/ticketmaster.go b/pkg/detectors/ticketmaster/ticketmaster.go
index 759796b33..1384ca5c1 100644
--- a/pkg/detectors/ticketmaster/ticketmaster.go
+++ b/pkg/detectors/ticketmaster/ticketmaster.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tiingo/tiingo.go b/pkg/detectors/tiingo/tiingo.go
index a8af6c8f9..3b1c00049 100644
--- a/pkg/detectors/tiingo/tiingo.go
+++ b/pkg/detectors/tiingo/tiingo.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/timecamp/timecamp.go b/pkg/detectors/timecamp/timecamp.go
index 4addd7b9e..e5942668f 100644
--- a/pkg/detectors/timecamp/timecamp.go
+++ b/pkg/detectors/timecamp/timecamp.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/timezoneapi/timezoneapi.go b/pkg/detectors/timezoneapi/timezoneapi.go
index 30737eb4c..617136016 100644
--- a/pkg/detectors/timezoneapi/timezoneapi.go
+++ b/pkg/detectors/timezoneapi/timezoneapi.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tineswebhook/tineswebhook.go b/pkg/detectors/tineswebhook/tineswebhook.go
index 5ce4bd3fa..34fc3a989 100644
--- a/pkg/detectors/tineswebhook/tineswebhook.go
+++ b/pkg/detectors/tineswebhook/tineswebhook.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tly/tly.go b/pkg/detectors/tly/tly.go
index 9c5c9d8ba..0a31e210c 100644
--- a/pkg/detectors/tly/tly.go
+++ b/pkg/detectors/tly/tly.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tmetric/tmetric.go b/pkg/detectors/tmetric/tmetric.go
index 2b522706a..636d91921 100644
--- a/pkg/detectors/tmetric/tmetric.go
+++ b/pkg/detectors/tmetric/tmetric.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/todoist/todoist.go b/pkg/detectors/todoist/todoist.go
index 8b4af8651..06d11228c 100644
--- a/pkg/detectors/todoist/todoist.go
+++ b/pkg/detectors/todoist/todoist.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/toggltrack/toggltrack.go b/pkg/detectors/toggltrack/toggltrack.go
index cde7275d5..69960abf6 100644
--- a/pkg/detectors/toggltrack/toggltrack.go
+++ b/pkg/detectors/toggltrack/toggltrack.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tokeet/tokeet.go b/pkg/detectors/tokeet/tokeet.go
index 0ae00b745..e580299dc 100644
--- a/pkg/detectors/tokeet/tokeet.go
+++ b/pkg/detectors/tokeet/tokeet.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tomorrowio/tomorrowio.go b/pkg/detectors/tomorrowio/tomorrowio.go
index 8509801d8..5bc673fe1 100644
--- a/pkg/detectors/tomorrowio/tomorrowio.go
+++ b/pkg/detectors/tomorrowio/tomorrowio.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tomtom/tomtom.go b/pkg/detectors/tomtom/tomtom.go
index 1c9f6074e..f606aa0f8 100644
--- a/pkg/detectors/tomtom/tomtom.go
+++ b/pkg/detectors/tomtom/tomtom.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tradier/tradier.go b/pkg/detectors/tradier/tradier.go
index aaed876f9..e32f44ba0 100644
--- a/pkg/detectors/tradier/tradier.go
+++ b/pkg/detectors/tradier/tradier.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/transferwise/transferwise.go b/pkg/detectors/transferwise/transferwise.go
index f4413bbe1..af36aa3d0 100644
--- a/pkg/detectors/transferwise/transferwise.go
+++ b/pkg/detectors/transferwise/transferwise.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/travelpayouts/travelpayouts.go b/pkg/detectors/travelpayouts/travelpayouts.go
index 57ab48dc5..d33501151 100644
--- a/pkg/detectors/travelpayouts/travelpayouts.go
+++ b/pkg/detectors/travelpayouts/travelpayouts.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/travisci/travisci.go b/pkg/detectors/travisci/travisci.go
index f100164c3..56972ea96 100644
--- a/pkg/detectors/travisci/travisci.go
+++ b/pkg/detectors/travisci/travisci.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/trelloapikey/trelloapikey.go b/pkg/detectors/trelloapikey/trelloapikey.go
index 9bac7cecf..0e67c4ada 100644
--- a/pkg/detectors/trelloapikey/trelloapikey.go
+++ b/pkg/detectors/trelloapikey/trelloapikey.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if i == 0 {
resMatch := strings.TrimSpace(match[1])
for _, tokenMatch := range tokenMatches {
- if len(tokenMatch) != 2 {
- continue
- }
token := strings.TrimSpace(tokenMatch[1])
diff --git a/pkg/detectors/tru/tru.go b/pkg/detectors/tru/tru.go
index 3719a5d5a..43ccfcb9e 100644
--- a/pkg/detectors/tru/tru.go
+++ b/pkg/detectors/tru/tru.go
@@ -42,14 +42,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
secretMatches := secrePat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, secretMatch := range secretMatches {
- if len(secretMatch) != 2 {
- continue
- }
resSecret := strings.TrimSpace(secretMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/trufflehogenterprise/trufflehogenterprise.go b/pkg/detectors/trufflehogenterprise/trufflehogenterprise.go
index 1b3374582..ae44d15a2 100644
--- a/pkg/detectors/trufflehogenterprise/trufflehogenterprise.go
+++ b/pkg/detectors/trufflehogenterprise/trufflehogenterprise.go
@@ -43,21 +43,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
hostnameMatches := hostnamePat.FindAllStringSubmatch(dataStr, -1)
for _, keyMatch := range keyMatches {
- if len(keyMatch) != 1 {
- continue
- }
resKeyMatch := strings.TrimSpace(keyMatch[0])
for _, secretMatch := range secretMatches {
-
- if len(secretMatch) != 1 {
- continue
- }
resSecretMatch := strings.TrimSpace(secretMatch[0])
for _, hostnameMatch := range hostnameMatches {
- if len(hostnameMatch) != 1 {
- continue
- }
resHostnameMatch := strings.TrimSpace(hostnameMatch[0])
diff --git a/pkg/detectors/twelvedata/twelvedata.go b/pkg/detectors/twelvedata/twelvedata.go
index 711a70f6a..afc2d50b9 100644
--- a/pkg/detectors/twelvedata/twelvedata.go
+++ b/pkg/detectors/twelvedata/twelvedata.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/twist/twist.go b/pkg/detectors/twist/twist.go
index 1e46bfc45..819c3eff5 100644
--- a/pkg/detectors/twist/twist.go
+++ b/pkg/detectors/twist/twist.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := accessToken.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
setAuth := resMatch
diff --git a/pkg/detectors/twitch/twitch.go b/pkg/detectors/twitch/twitch.go
index 8ae73211b..3babf4e2f 100644
--- a/pkg/detectors/twitch/twitch.go
+++ b/pkg/detectors/twitch/twitch.go
@@ -47,15 +47,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/tyntec/tyntec.go b/pkg/detectors/tyntec/tyntec.go
index 3b365a8d4..e5fff0538 100644
--- a/pkg/detectors/tyntec/tyntec.go
+++ b/pkg/detectors/tyntec/tyntec.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/typeform/v1/typeform.go b/pkg/detectors/typeform/v1/typeform.go
index 9b365c123..f8a2574b1 100644
--- a/pkg/detectors/typeform/v1/typeform.go
+++ b/pkg/detectors/typeform/v1/typeform.go
@@ -41,9 +41,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/typetalk/typetalk.go b/pkg/detectors/typetalk/typetalk.go
index bbd61d35f..850a0f91a 100644
--- a/pkg/detectors/typetalk/typetalk.go
+++ b/pkg/detectors/typetalk/typetalk.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
- if len(idMatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/ubidots/ubidots.go b/pkg/detectors/ubidots/ubidots.go
index ea694921d..94e6a944d 100644
--- a/pkg/detectors/ubidots/ubidots.go
+++ b/pkg/detectors/ubidots/ubidots.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/uclassify/uclassify.go b/pkg/detectors/uclassify/uclassify.go
index 6972e28cf..d70bdd167 100644
--- a/pkg/detectors/uclassify/uclassify.go
+++ b/pkg/detectors/uclassify/uclassify.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/unifyid/unifyid.go b/pkg/detectors/unifyid/unifyid.go
index f77444109..4a71c3088 100644
--- a/pkg/detectors/unifyid/unifyid.go
+++ b/pkg/detectors/unifyid/unifyid.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/unplugg/unplugg.go b/pkg/detectors/unplugg/unplugg.go
index f24ef97c9..39c809efa 100644
--- a/pkg/detectors/unplugg/unplugg.go
+++ b/pkg/detectors/unplugg/unplugg.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/unsplash/unsplash.go b/pkg/detectors/unsplash/unsplash.go
index 5d592f5c9..c0e9d1826 100644
--- a/pkg/detectors/unsplash/unsplash.go
+++ b/pkg/detectors/unsplash/unsplash.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/upcdatabase/upcdatabase.go b/pkg/detectors/upcdatabase/upcdatabase.go
index 5053bc4c9..7774ca93b 100644
--- a/pkg/detectors/upcdatabase/upcdatabase.go
+++ b/pkg/detectors/upcdatabase/upcdatabase.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/uplead/uplead.go b/pkg/detectors/uplead/uplead.go
index 71c396334..1a141fc8e 100644
--- a/pkg/detectors/uplead/uplead.go
+++ b/pkg/detectors/uplead/uplead.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/uploadcare/uploadcare.go b/pkg/detectors/uploadcare/uploadcare.go
index 94878c05e..df0c30f37 100644
--- a/pkg/detectors/uploadcare/uploadcare.go
+++ b/pkg/detectors/uploadcare/uploadcare.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
publicMatches := publicKeyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, publicMatch := range publicMatches {
- if len(publicMatch) != 2 {
- continue
- }
publicKeyMatch := strings.TrimSpace(publicMatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_UploadCare,
diff --git a/pkg/detectors/uptimerobot/uptimerobot.go b/pkg/detectors/uptimerobot/uptimerobot.go
index 24b3e9754..d6aeb1113 100644
--- a/pkg/detectors/uptimerobot/uptimerobot.go
+++ b/pkg/detectors/uptimerobot/uptimerobot.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/upwave/upwave.go b/pkg/detectors/upwave/upwave.go
index 80c6c6c46..c6f0b66d6 100644
--- a/pkg/detectors/upwave/upwave.go
+++ b/pkg/detectors/upwave/upwave.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/urlscan/urlscan.go b/pkg/detectors/urlscan/urlscan.go
index a4f877d57..0f66546ff 100644
--- a/pkg/detectors/urlscan/urlscan.go
+++ b/pkg/detectors/urlscan/urlscan.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/user/user.go b/pkg/detectors/user/user.go
index 890f73c1b..aea72d3e0 100644
--- a/pkg/detectors/user/user.go
+++ b/pkg/detectors/user/user.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/userflow/userflow.go b/pkg/detectors/userflow/userflow.go
index 150cb6f20..7cf64e3de 100644
--- a/pkg/detectors/userflow/userflow.go
+++ b/pkg/detectors/userflow/userflow.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/userstack/userstack.go b/pkg/detectors/userstack/userstack.go
index 9830c8cd6..864445c01 100644
--- a/pkg/detectors/userstack/userstack.go
+++ b/pkg/detectors/userstack/userstack.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/vagrantcloudpersonaltoken/vagrantcloudpersonaltoken.go b/pkg/detectors/vagrantcloudpersonaltoken/vagrantcloudpersonaltoken.go
index d448e35d5..37bd5107b 100644
--- a/pkg/detectors/vagrantcloudpersonaltoken/vagrantcloudpersonaltoken.go
+++ b/pkg/detectors/vagrantcloudpersonaltoken/vagrantcloudpersonaltoken.go
@@ -3,10 +3,11 @@ package vagrantcloudpersonaltoken
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -38,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/vatlayer/vatlayer.go b/pkg/detectors/vatlayer/vatlayer.go
index 7fd7456d6..deca19f33 100644
--- a/pkg/detectors/vatlayer/vatlayer.go
+++ b/pkg/detectors/vatlayer/vatlayer.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/vbout/vbout.go b/pkg/detectors/vbout/vbout.go
index c777f2147..d5dfbb156 100644
--- a/pkg/detectors/vbout/vbout.go
+++ b/pkg/detectors/vbout/vbout.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/vercel/vercel.go b/pkg/detectors/vercel/vercel.go
index 1227b03b2..f2eb960fa 100644
--- a/pkg/detectors/vercel/vercel.go
+++ b/pkg/detectors/vercel/vercel.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/verifier/verifier.go b/pkg/detectors/verifier/verifier.go
index 854364051..ac8dbccad 100644
--- a/pkg/detectors/verifier/verifier.go
+++ b/pkg/detectors/verifier/verifier.go
@@ -46,9 +46,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for emailMatch := range uniqueEmailMatches {
diff --git a/pkg/detectors/verimail/verimail.go b/pkg/detectors/verimail/verimail.go
index 3462f8394..45268496e 100644
--- a/pkg/detectors/verimail/verimail.go
+++ b/pkg/detectors/verimail/verimail.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/veriphone/veriphone.go b/pkg/detectors/veriphone/veriphone.go
index 8e9d71a94..030705582 100644
--- a/pkg/detectors/veriphone/veriphone.go
+++ b/pkg/detectors/veriphone/veriphone.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/versioneye/versioneye.go b/pkg/detectors/versioneye/versioneye.go
index cd24b9ae5..642a689c4 100644
--- a/pkg/detectors/versioneye/versioneye.go
+++ b/pkg/detectors/versioneye/versioneye.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/viewneo/viewneo.go b/pkg/detectors/viewneo/viewneo.go
index 662a2e4fc..710a4d9b5 100644
--- a/pkg/detectors/viewneo/viewneo.go
+++ b/pkg/detectors/viewneo/viewneo.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/virustotal/virustotal.go b/pkg/detectors/virustotal/virustotal.go
index 519fa3d2f..063dd2578 100644
--- a/pkg/detectors/virustotal/virustotal.go
+++ b/pkg/detectors/virustotal/virustotal.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/visualcrossing/visualcrossing.go b/pkg/detectors/visualcrossing/visualcrossing.go
index 92ca10d93..48bfa46e6 100644
--- a/pkg/detectors/visualcrossing/visualcrossing.go
+++ b/pkg/detectors/visualcrossing/visualcrossing.go
@@ -3,10 +3,11 @@ package visualcrossing
import (
"context"
"fmt"
- regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"
+ regexp "github.com/wasilibs/go-re2"
+
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -37,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/voiceflow/voiceflow.go b/pkg/detectors/voiceflow/voiceflow.go
index f49fbfad6..10d5c2af3 100644
--- a/pkg/detectors/voiceflow/voiceflow.go
+++ b/pkg/detectors/voiceflow/voiceflow.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/voicegain/voicegain.go b/pkg/detectors/voicegain/voicegain.go
index cd69ab70e..6c3eff233 100644
--- a/pkg/detectors/voicegain/voicegain.go
+++ b/pkg/detectors/voicegain/voicegain.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/voodoosms/voodoosms.go b/pkg/detectors/voodoosms/voodoosms.go
index b7612ec8f..7e2b8e427 100644
--- a/pkg/detectors/voodoosms/voodoosms.go
+++ b/pkg/detectors/voodoosms/voodoosms.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/vouchery/vouchery.go b/pkg/detectors/vouchery/vouchery.go
index 901f9a39d..5e4668b1f 100644
--- a/pkg/detectors/vouchery/vouchery.go
+++ b/pkg/detectors/vouchery/vouchery.go
@@ -41,15 +41,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
subMatches := subPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, subMatch := range subMatches {
- if len(subMatch) != 2 {
- continue
- }
subMatch := strings.TrimSpace(subMatch[1])
diff --git a/pkg/detectors/vpnapi/vpnapi.go b/pkg/detectors/vpnapi/vpnapi.go
index 7a75b620e..1a3fc2846 100644
--- a/pkg/detectors/vpnapi/vpnapi.go
+++ b/pkg/detectors/vpnapi/vpnapi.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/vultrapikey/vultrapikey.go b/pkg/detectors/vultrapikey/vultrapikey.go
index 6702ff296..bf3cdf303 100644
--- a/pkg/detectors/vultrapikey/vultrapikey.go
+++ b/pkg/detectors/vultrapikey/vultrapikey.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/vyte/vyte.go b/pkg/detectors/vyte/vyte.go
index 63d39b82e..e6e423d83 100644
--- a/pkg/detectors/vyte/vyte.go
+++ b/pkg/detectors/vyte/vyte.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/walkscore/walkscore.go b/pkg/detectors/walkscore/walkscore.go
index 02e3431b5..50c997854 100644
--- a/pkg/detectors/walkscore/walkscore.go
+++ b/pkg/detectors/walkscore/walkscore.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/weatherbit/weatherbit.go b/pkg/detectors/weatherbit/weatherbit.go
index 36146e2fd..886759bee 100644
--- a/pkg/detectors/weatherbit/weatherbit.go
+++ b/pkg/detectors/weatherbit/weatherbit.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/weatherstack/weatherstack.go b/pkg/detectors/weatherstack/weatherstack.go
index 2ba937889..6e0b71be8 100644
--- a/pkg/detectors/weatherstack/weatherstack.go
+++ b/pkg/detectors/weatherstack/weatherstack.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/web3storage/web3storage.go b/pkg/detectors/web3storage/web3storage.go
index 646385967..e5d7f9611 100644
--- a/pkg/detectors/web3storage/web3storage.go
+++ b/pkg/detectors/web3storage/web3storage.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/webex/webex.go b/pkg/detectors/webex/webex.go
index 6dac7504e..d13ab835f 100644
--- a/pkg/detectors/webex/webex.go
+++ b/pkg/detectors/webex/webex.go
@@ -39,15 +39,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idMatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idMatch := range idMatches {
-
- if len(idMatch) != 2 {
- continue
- }
id := strings.TrimSpace(idMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/webflow/webflow.go b/pkg/detectors/webflow/webflow.go
index 711570e0f..1db49826e 100644
--- a/pkg/detectors/webflow/webflow.go
+++ b/pkg/detectors/webflow/webflow.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/webscraper/webscraper.go b/pkg/detectors/webscraper/webscraper.go
index 18c6bbf1c..f992f8675 100644
--- a/pkg/detectors/webscraper/webscraper.go
+++ b/pkg/detectors/webscraper/webscraper.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/webscraping/webscraping.go b/pkg/detectors/webscraping/webscraping.go
index a355ab427..4e0b1fe34 100644
--- a/pkg/detectors/webscraping/webscraping.go
+++ b/pkg/detectors/webscraping/webscraping.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/websitepulse/websitepulse.go b/pkg/detectors/websitepulse/websitepulse.go
index 4a02745c0..4b6250f5d 100644
--- a/pkg/detectors/websitepulse/websitepulse.go
+++ b/pkg/detectors/websitepulse/websitepulse.go
@@ -42,15 +42,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdMatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Websitepulse,
diff --git a/pkg/detectors/wepay/wepay.go b/pkg/detectors/wepay/wepay.go
index 7c96139ee..b2c21abd0 100644
--- a/pkg/detectors/wepay/wepay.go
+++ b/pkg/detectors/wepay/wepay.go
@@ -42,16 +42,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
resAppIDMatch := ""
for _, appIDMatch := range appIDmatches {
- if len(appIDMatch) != 2 {
- continue
- }
resAppIDMatch = strings.TrimSpace(appIDMatch[1])
}
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_WePay,
diff --git a/pkg/detectors/whoxy/whoxy.go b/pkg/detectors/whoxy/whoxy.go
index 3127711ee..e358a8909 100644
--- a/pkg/detectors/whoxy/whoxy.go
+++ b/pkg/detectors/whoxy/whoxy.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/wistia/wistia.go b/pkg/detectors/wistia/wistia.go
index 1d8a87105..93806bb1b 100644
--- a/pkg/detectors/wistia/wistia.go
+++ b/pkg/detectors/wistia/wistia.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/wit/wit.go b/pkg/detectors/wit/wit.go
index 002768d24..0da015d27 100644
--- a/pkg/detectors/wit/wit.go
+++ b/pkg/detectors/wit/wit.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/worksnaps/worksnaps.go b/pkg/detectors/worksnaps/worksnaps.go
index dd98a2400..df509bdc4 100644
--- a/pkg/detectors/worksnaps/worksnaps.go
+++ b/pkg/detectors/worksnaps/worksnaps.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/workstack/workstack.go b/pkg/detectors/workstack/workstack.go
index 16f68e484..8dbaac536 100644
--- a/pkg/detectors/workstack/workstack.go
+++ b/pkg/detectors/workstack/workstack.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/worldcoinindex/worldcoinindex.go b/pkg/detectors/worldcoinindex/worldcoinindex.go
index bb893a21e..b20766ae2 100644
--- a/pkg/detectors/worldcoinindex/worldcoinindex.go
+++ b/pkg/detectors/worldcoinindex/worldcoinindex.go
@@ -39,9 +39,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/worldweather/worldweather.go b/pkg/detectors/worldweather/worldweather.go
index ef23131ec..f7e732be1 100644
--- a/pkg/detectors/worldweather/worldweather.go
+++ b/pkg/detectors/worldweather/worldweather.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/wrike/wrike.go b/pkg/detectors/wrike/wrike.go
index 5e8bee35e..d9fb23be4 100644
--- a/pkg/detectors/wrike/wrike.go
+++ b/pkg/detectors/wrike/wrike.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/yandex/yandex.go b/pkg/detectors/yandex/yandex.go
index 905ce34e0..ef2e3deb3 100644
--- a/pkg/detectors/yandex/yandex.go
+++ b/pkg/detectors/yandex/yandex.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/yelp/yelp.go b/pkg/detectors/yelp/yelp.go
index bb323e896..cb0c37408 100644
--- a/pkg/detectors/yelp/yelp.go
+++ b/pkg/detectors/yelp/yelp.go
@@ -40,9 +40,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/youneedabudget/youneedabudget.go b/pkg/detectors/youneedabudget/youneedabudget.go
index fb1d50c59..896b19ae0 100644
--- a/pkg/detectors/youneedabudget/youneedabudget.go
+++ b/pkg/detectors/youneedabudget/youneedabudget.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/yousign/yousign.go b/pkg/detectors/yousign/yousign.go
index 96bd55ef5..8e0fecc1a 100644
--- a/pkg/detectors/yousign/yousign.go
+++ b/pkg/detectors/yousign/yousign.go
@@ -42,9 +42,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/youtubeapikey/youtubeapikey.go b/pkg/detectors/youtubeapikey/youtubeapikey.go
index b03e3a981..94de2994b 100644
--- a/pkg/detectors/youtubeapikey/youtubeapikey.go
+++ b/pkg/detectors/youtubeapikey/youtubeapikey.go
@@ -40,15 +40,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
idmatches := idPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
for _, idmatch := range idmatches {
- if len(idmatch) != 2 {
- continue
- }
resIdmatch := strings.TrimSpace(idmatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zapierwebhook/zapierwebhook.go b/pkg/detectors/zapierwebhook/zapierwebhook.go
index 9779c9c46..bd0a7f3d1 100644
--- a/pkg/detectors/zapierwebhook/zapierwebhook.go
+++ b/pkg/detectors/zapierwebhook/zapierwebhook.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zendeskapi/zendeskapi.go b/pkg/detectors/zendeskapi/zendeskapi.go
index 296217109..30b1357b3 100644
--- a/pkg/detectors/zendeskapi/zendeskapi.go
+++ b/pkg/detectors/zendeskapi/zendeskapi.go
@@ -43,22 +43,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
emails := email.FindAllStringSubmatch(dataStr, -1)
for _, token := range tokens {
- if len(token) != 2 {
- continue
- }
resMatch := strings.TrimSpace(token[1])
var resDomain string
for _, domain := range domains {
- if len(domain) != 2 {
- continue
- }
resDomain = strings.TrimSpace(domain[1])
for _, email := range emails {
- if len(email) != 2 {
- continue
- }
resEmail := strings.TrimSpace(email[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zenkitapi/zenkitapi.go b/pkg/detectors/zenkitapi/zenkitapi.go
index 9ed1919fb..8c5c6e6d7 100644
--- a/pkg/detectors/zenkitapi/zenkitapi.go
+++ b/pkg/detectors/zenkitapi/zenkitapi.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zenrows/zenrows.go b/pkg/detectors/zenrows/zenrows.go
index c52170305..e7be3b50d 100644
--- a/pkg/detectors/zenrows/zenrows.go
+++ b/pkg/detectors/zenrows/zenrows.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zenscrape/zenscrape.go b/pkg/detectors/zenscrape/zenscrape.go
index d0412aa43..c66b4d446 100644
--- a/pkg/detectors/zenscrape/zenscrape.go
+++ b/pkg/detectors/zenscrape/zenscrape.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zenserp/zenserp.go b/pkg/detectors/zenserp/zenserp.go
index 737264d6a..3b3504aca 100644
--- a/pkg/detectors/zenserp/zenserp.go
+++ b/pkg/detectors/zenserp/zenserp.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zeplin/zeplin.go b/pkg/detectors/zeplin/zeplin.go
index b1ed035e2..2f731c40c 100644
--- a/pkg/detectors/zeplin/zeplin.go
+++ b/pkg/detectors/zeplin/zeplin.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zerobounce/zerobounce.go b/pkg/detectors/zerobounce/zerobounce.go
index fb0dc880e..42902753e 100644
--- a/pkg/detectors/zerobounce/zerobounce.go
+++ b/pkg/detectors/zerobounce/zerobounce.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zerotier/zerotier.go b/pkg/detectors/zerotier/zerotier.go
index 7622db9b5..51296922d 100644
--- a/pkg/detectors/zerotier/zerotier.go
+++ b/pkg/detectors/zerotier/zerotier.go
@@ -38,9 +38,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zipbooks/zipbooks.go b/pkg/detectors/zipbooks/zipbooks.go
index cfde9e458..9fc5fb9a8 100644
--- a/pkg/detectors/zipbooks/zipbooks.go
+++ b/pkg/detectors/zipbooks/zipbooks.go
@@ -47,9 +47,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
for emailMatch := range uniqueEmailMatches {
for _, pwordMatch := range pwordMatches {
- if len(pwordMatch) != 2 {
- continue
- }
resPword := strings.TrimSpace(pwordMatch[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zipcodeapi/zipcodeapi.go b/pkg/detectors/zipcodeapi/zipcodeapi.go
index a712c30fe..406f7ce45 100644
--- a/pkg/detectors/zipcodeapi/zipcodeapi.go
+++ b/pkg/detectors/zipcodeapi/zipcodeapi.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zipcodebase/zipcodebase.go b/pkg/detectors/zipcodebase/zipcodebase.go
index 6c17891a5..c176e033f 100644
--- a/pkg/detectors/zipcodebase/zipcodebase.go
+++ b/pkg/detectors/zipcodebase/zipcodebase.go
@@ -37,9 +37,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{
diff --git a/pkg/detectors/zonkafeedback/zonkafeedback.go b/pkg/detectors/zonkafeedback/zonkafeedback.go
index af1ddd87b..287b939b0 100644
--- a/pkg/detectors/zonkafeedback/zonkafeedback.go
+++ b/pkg/detectors/zonkafeedback/zonkafeedback.go
@@ -36,9 +36,6 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
for _, match := range matches {
- if len(match) != 2 {
- continue
- }
resMatch := strings.TrimSpace(match[1])
s1 := detectors.Result{