From 96d603d11142b4a0fb2ff7c653f16cf8b34af9f2 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 12 May 2024 10:59:19 +0200 Subject: [PATCH] test: use static errors --- .golangci.yml | 6 ------ github/github_test.go | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 451e5a0..5de88c8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -95,9 +95,3 @@ run: linters-settings: gofumpt: extra-rules: true - -issues: - exclude-rules: - - path: "_test.go" - linters: - - err113 diff --git a/github/github_test.go b/github/github_test.go index a1c63d8..04dafa6 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -12,6 +12,8 @@ import ( "github.com/thegeeklab/wp-github-comment/github/mocks" ) +var ErrInternalServerError = errors.New("internal server error") + func TestGithubIssue_FindComment(t *testing.T) { tests := []struct { name string @@ -156,7 +158,7 @@ func TestGithubIssue_AddComment(t *testing.T) { Message: "test message", Update: false, }, - wantErr: errors.New("internal server error"), + wantErr: ErrInternalServerError, }, }