Skip to content

Commit

Permalink
test: use static errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys committed May 12, 2024
1 parent d88993d commit 750b60a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,3 @@ run:
linters-settings:
gofumpt:
extra-rules: true

issues:
exclude-rules:
- path: "_test.go"
linters:
- err113
4 changes: 3 additions & 1 deletion gitea/gitea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"github.com/thegeeklab/wp-gitea-release/gitea/mocks"
)

var ErrNoSuchFileOrDirectory = errors.New("no such file or directory")

func TestReleaseFind(t *testing.T) {
tests := []struct {
name string
Expand Down Expand Up @@ -256,7 +258,7 @@ func TestReleaseAddAttachments(t *testing.T) {
FileExists: "overwrite",
},
files: []string{"testdata/file1.txt", "testdata/invalid.txt"},
wantErr: errors.New("no such file or directory"),
wantErr: ErrNoSuchFileOrDirectory,
},
}

Expand Down

0 comments on commit 750b60a

Please sign in to comment.