diff --git a/.golangci.yml b/.golangci.yml index c8bf9e9..4fb795b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,6 +4,7 @@ linters: disable-all: true enable: - bidichk + - ineffassign - unused - goconst - gofmt diff --git a/cmd/utility_test.go b/cmd/utility_test.go index d00e6af..528d40f 100644 --- a/cmd/utility_test.go +++ b/cmd/utility_test.go @@ -15,7 +15,7 @@ func TestPackageCfg(t *testing.T) { // Test error cases first. args := []string{"@"} - cfg, err := packageCfg(args) + _, err := packageCfg(args) assert.Error(t, err, "it has an api_key_error") // Test non-error case. @@ -23,7 +23,7 @@ func TestPackageCfg(t *testing.T) { viper.Set("tips_api_key", "foo") viper.Set("tailnet", "bar") - cfg, err = packageCfg(args) + cfg, err := packageCfg(args) assert.NoError(t, err) assert.NotNil(t, cfg) diff --git a/pkg/filters_test.go b/pkg/filters_test.go index 7a3df3f..271f7d4 100644 --- a/pkg/filters_test.go +++ b/pkg/filters_test.go @@ -10,16 +10,16 @@ func TestParseFilter(t *testing.T) { // Note: much more robust testing of the parser occurs in the filtercomp package. // It makes this testing somewhat redundant. - // An filter expression with imbalanced parenthesis should return an error. - ast, err := ParseFilter("(hello, world") + // A filter expression with imbalanced parenthesis should return an error. + _, err := ParseFilter("(hello, world") assert.Error(t, err, "imbalanced parenthesis detected") // An empty filter should return no error with a nil ast. - ast, err = ParseFilter("") + ast, err := ParseFilter("") assert.NoError(t, err) assert.Nil(t, ast) // An empty filter should return no error with a nil ast. - ast, err = ParseFilter("how are you doing?") + _, err = ParseFilter("how are you doing?") assert.Error(t, err, "parser did not run to completion, tokens were not fully consumed") }