From b6ef6d9351bd397380a5678d7b18ddf2fcccdc94 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Wed, 9 Feb 2022 21:58:17 -0300 Subject: [PATCH] fix: linter issues Signed-off-by: Carlos A Becker --- .golangci.yml | 32 -------------------------------- glob_test.go | 10 ++++++++-- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 6bb1353..45e6183 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,35 +11,3 @@ linters: - gci - exhaustivestruct - varnamelen -linters-settings: - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true - gocyclo: - # minimal code complexity to report, 30 by default (but we recommend 10-20) - min-complexity: 30 - goimports: - # put imports beginning with prefix after 3rd-party packages; - # it's a comma-separated list of prefixes - local-prefixes: github.com/goreleaser/fileglob - govet: - check-shadowing: true - errcheck: - ignore: ^Close.*,fmt:.*,github.com/pkg/errors:^Wrap.*,os:^Setenv$ - lll: - line-length: 200 - golint: - min-confidence: .8 - nakedret: - max-func-lines: 0 - gocritic: - disabled-checks: - - whyNoLint - enabled-tags: - - style - - performance -issues: - exclude-rules: - - text: "G104" # gosec G104 is caught by errcheck - linters: - - gosec diff --git a/glob_test.go b/glob_test.go index 1f179f8..b8833a9 100644 --- a/glob_test.go +++ b/glob_test.go @@ -54,7 +54,10 @@ func TestGlob(t *testing.T) { // nolint:funlen toNixPath(filepath.Join(wd, "glob_test.go")), toNixPath(filepath.Join(wd, "prefix_test.go")), }, matches) - is.Equal(fmt.Sprintf("&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}", prefix, prefix, pattern), w.String()) + is.Equal(fmt.Sprintf( + "&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}", + prefix, prefix, pattern, + ), w.String()) }) t.Run("real with rootfs direct file", func(t *testing.T) { @@ -98,7 +101,10 @@ func TestGlob(t *testing.T) { // nolint:funlen is.True(err != nil) // expected an error is.True(strings.HasSuffix(err.Error(), "file does not exist")) // should have been file does not exist is.Equal([]string{}, matches) - is.Equal(fmt.Sprintf("&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}", prefix, prefix, glob.QuoteMeta(abs)), w.String()) + is.Equal(fmt.Sprintf( + "&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}", + prefix, prefix, glob.QuoteMeta(abs), + ), w.String()) }) t.Run("real with rootfs on relative path to parent", func(t *testing.T) {