diff --git a/.golangci.yml b/.golangci.yml index 672255f..70fed41 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,7 +8,6 @@ linters: - cyclop - depguard - err113 - - errorlint - forbidigo - gochecknoglobals - gochecknoinits diff --git a/internal/actions/assign/assign_test.go b/internal/actions/assign/assign_test.go index 1da5195..59aa855 100644 --- a/internal/actions/assign/assign_test.go +++ b/internal/actions/assign/assign_test.go @@ -60,7 +60,7 @@ func TestRun(t *testing.T) { }, } - if err := runner.Run(n, []string{"user"}, w); err != expectedError { + if err := runner.Run(n, []string{"user"}, w); !errors.Is(err, expectedError) { t.Fatalf("expected %#v but got %#v", expectedError, err) } diff --git a/internal/gh/gh_test.go b/internal/gh/gh_test.go index fef8937..23b69c5 100644 --- a/internal/gh/gh_test.go +++ b/internal/gh/gh_test.go @@ -316,7 +316,7 @@ func TestRequest(t *testing.T) { t.Errorf("expected test to fails") } - if err != expectedError { + if !errors.Is(err, expectedError) { t.Errorf("expected %#v, got %#v", expectedError, err) } @@ -576,7 +576,7 @@ func TestEnrich(t *testing.T) { notification: mockNotification(0), assertError: func(t *testing.T, err error) { t.Helper() - if err != errSample { + if !errors.Is(err, errSample) { t.Errorf("expected to fail with %#v but got %#v", errSample, err) } }, diff --git a/internal/jq/jq.go b/internal/jq/jq.go index e91ffeb..cbde346 100644 --- a/internal/jq/jq.go +++ b/internal/jq/jq.go @@ -1,6 +1,7 @@ package jq import ( + "errors" "fmt" "github.com/itchyny/gojq" @@ -39,8 +40,9 @@ func Filter(filter string, n notifications.Notifications) (notifications.Notific break } - if err, ok := v.(error); ok { - if err, ok := err.(*gojq.HaltError); ok && err.Value() == nil { + if err, ok = v.(error); ok { + haltError := &gojq.HaltError{} + if ok = errors.As(err, &haltError); ok && haltError.Value() == nil { break } return nil, err