Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Apr 18, 2024
1 parent 1509d15 commit 0798ede
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
with:
go-version: 1.21

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: lint
run: go run github.com/ysmood/golangci-lint@latest
run: go run github.com/ysmood/golangci-lint@latest -v 1.57.2

- name: test
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
with:
go-version: 1.21

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: lint
if: matrix.os == 'ubuntu-latest'
run: go run github.com/ysmood/golangci-lint@latest
run: go run github.com/ysmood/golangci-lint@latest -v 1.57.2

- name: test
env:
Expand Down
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
run:
skip-dirs-use-default: false

linters:
enable:
- gofmt
Expand All @@ -13,4 +10,4 @@ linters-settings:
min-complexity: 15

issues:
exclude-use-default: false
exclude-dirs-use-default: false
2 changes: 1 addition & 1 deletion each_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestPanicAsFailure(t *testing.T) {
as := got.New(t)

m := &mock{t: t}
it := func(t *mock) PanicAsFailure { return PanicAsFailure{} }
it := func(_ *mock) PanicAsFailure { return PanicAsFailure{} }
as.Eq(got.Each(m, it), 2)
as.True(m.failed)
as.Has(m.msg, "[panic] err")
Expand Down
2 changes: 1 addition & 1 deletion lib/diff/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var ThemeDefault = func(t Type) []gop.Style {
}

// ThemeNone colors for Sprint
var ThemeNone = func(t Type) []gop.Style {
var ThemeNone = func(_ Type) []gop.Style {
return []gop.Style{gop.None}
}

Expand Down
6 changes: 3 additions & 3 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ func TestHelper(t *testing.T) {
f, err := os.Open("go.mod")
ut.E(err)
s.Route("/c", ".html", f)
s.Mux.HandleFunc("/d", func(rw http.ResponseWriter, r *http.Request) {
s.Mux.HandleFunc("/d", func(_ http.ResponseWriter, r *http.Request) {
ut.Eq(ut.Read(r.Body).String(), "1\n")
})
s.Mux.HandleFunc("/f", func(rw http.ResponseWriter, r *http.Request) {
s.Mux.HandleFunc("/f", func(_ http.ResponseWriter, r *http.Request) {
ut.Has(r.Header.Get("Content-Type"), "application/json")
ut.Eq(r.Header.Get("Test-Header"), "ok")
ut.Eq(r.Host, "test.com")
})
s.Mux.HandleFunc("/timeout", func(rw http.ResponseWriter, r *http.Request) {
s.Mux.HandleFunc("/timeout", func(_ http.ResponseWriter, r *http.Request) {
<-r.Context().Done()
})

Expand Down

0 comments on commit 0798ede

Please sign in to comment.