diff --git a/.golangci.yml b/.golangci.yml index 450fafe..20ef06e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,6 +14,9 @@ linters: - goerr113 - gofumpt - exhaustivestruct + - forbidigo + - nlreturn + - wrapcheck issues: exclude-rules: @@ -25,6 +28,10 @@ issues: linters: - gocritic + - text: exitAfterDefer + linters: + - gocritic + - path: cli\\cmd\\.+\.go linters: - gochecknoinits diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 1959128..4d90aed 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -9,7 +9,6 @@ import ( "os/signal" "github.com/OJ/gobuster/v3/libgobuster" - "github.com/spf13/cobra" ) diff --git a/helper/helper_test.go b/helper/helper_test.go index e96e5a8..3ab9bfd 100644 --- a/helper/helper_test.go +++ b/helper/helper_test.go @@ -9,7 +9,6 @@ import ( func TestParseExtensions(t *testing.T) { t.Parallel() - var tt = []struct { testName string extensions string @@ -41,7 +40,6 @@ func TestParseExtensions(t *testing.T) { func TestParseCommaSeparatedInt(t *testing.T) { t.Parallel() - var tt = []struct { testName string stringCodes string diff --git a/libgobuster/helpers_test.go b/libgobuster/helpers_test.go index 196869b..9c5d057 100644 --- a/libgobuster/helpers_test.go +++ b/libgobuster/helpers_test.go @@ -161,7 +161,9 @@ func TestLineCounter(t *testing.T) { {"Empty", "", 1}, } for _, x := range tt { + x := x // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables t.Run(x.testName, func(t *testing.T) { + t.Parallel() r := strings.NewReader(x.s) l, err := lineCounter(r) if err != nil {