From 254c6ef1dddaba06b465adef16955d4fb1158a67 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Sat, 20 Aug 2022 15:25:39 +0200 Subject: [PATCH] build: add lint ignore comment required for golangci-staticcheck in addition to stand-alone staticcheck --- fs/config_test.go | 4 +++- fs/filter/filter_test.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/config_test.go b/fs/config_test.go index f9157bbf6..141f1185d 100644 --- a/fs/config_test.go +++ b/fs/config_test.go @@ -11,7 +11,9 @@ func TestGetConfig(t *testing.T) { ctx := context.Background() // Check nil - config := GetConfig(nil) //lint:ignore SA1012 we want to test passing a nil Context and therefore ignore lint suggestion of using context.TODO + //lint:ignore SA1012 false positive when running staticcheck, we want to test passing a nil Context and therefore ignore lint suggestion to use context.TODO + //nolint:staticcheck // Don't include staticcheck when running golangci-lint to avoid SA1012 + config := GetConfig(nil) assert.Equal(t, globalConfig, config) // Check empty config diff --git a/fs/filter/filter_test.go b/fs/filter/filter_test.go index ca24ecf27..91723f0a0 100644 --- a/fs/filter/filter_test.go +++ b/fs/filter/filter_test.go @@ -848,7 +848,9 @@ func TestGetConfig(t *testing.T) { ctx := context.Background() // Check nil - config := GetConfig(nil) //lint:ignore SA1012 we want to test passing a nil Context and therefore ignore lint suggestion of using context.TODO + //lint:ignore SA1012 false positive when running staticcheck, we want to test passing a nil Context and therefore ignore lint suggestion to use context.TODO + //nolint:staticcheck // Don't include staticcheck when running golangci-lint to avoid SA1012 + config := GetConfig(nil) assert.Equal(t, globalConfig, config) // Check empty config