Skip to content

Commit

Permalink
chore: Update golangci-lint to v1.57.1 (#2929)
Browse files Browse the repository at this point in the history
* Update linter.yml

* Fix issues from golangci-lint v1.57.1
  • Loading branch information
gaby authored Mar 24, 2024
1 parent 5e8df0a commit 3209052
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
uses: golangci/golangci-lint-action@v4
with:
# NOTE: Keep this in sync with the version from .golangci.yml
version: v1.56.2
version: v1.57.1
7 changes: 3 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# v1.2.0. Created based on golangci-lint v1.56.2
# v1.2.0. Created based on golangci-lint v1.57.1

run:
timeout: 5m
skip-dirs-use-default: false
modules-download-mode: readonly
allow-serial-runners: true
skip-dirs:
- internal # TODO: Do not ignore interal

output:
sort-results: true
Expand Down Expand Up @@ -255,6 +252,8 @@ issues:
exclude-case-sensitive: true
max-issues-per-linter: 0
max-same-issues: 0
exclude-dirs:
- internal # TODO: Do not ignore interal packages
exclude-rules:
- linters:
- goerr113
Expand Down
18 changes: 9 additions & 9 deletions client/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func Test_Exec_Func(t *testing.T) {
core.client = client
core.req = req

client.SetDial(func(_ string) (net.Conn, error) { return ln.Dial() }) //nolint:wrapcheck // not needed
client.SetDial(func(_ string) (net.Conn, error) { return ln.Dial() })
req.RawRequest.SetRequestURI("http://example.com/normal")

resp, err := core.execFunc()
Expand All @@ -104,7 +104,7 @@ func Test_Exec_Func(t *testing.T) {
core.client = client
core.req = req

client.SetDial(func(_ string) (net.Conn, error) { return ln.Dial() }) //nolint:wrapcheck // not needed
client.SetDial(func(_ string) (net.Conn, error) { return ln.Dial() })
req.RawRequest.SetRequestURI("http://example.com/return-error")

resp, err := core.execFunc()
Expand All @@ -124,7 +124,7 @@ func Test_Exec_Func(t *testing.T) {
core.client = client
core.req = req

client.SetDial(func(_ string) (net.Conn, error) { return ln.Dial() }) //nolint:wrapcheck // not needed
client.SetDial(func(_ string) (net.Conn, error) { return ln.Dial() })
req.RawRequest.SetRequestURI("http://example.com/hang-up")

_, err := core.execFunc()
Expand Down Expand Up @@ -163,7 +163,7 @@ func Test_Execute(t *testing.T) {
return nil
})
client.SetDial(func(_ string) (net.Conn, error) {
return ln.Dial() //nolint:wrapcheck // not needed
return ln.Dial()
})
req.SetURL("http://example.com")

Expand All @@ -180,7 +180,7 @@ func Test_Execute(t *testing.T) {
return nil
})
client.SetDial(func(_ string) (net.Conn, error) {
return ln.Dial() //nolint:wrapcheck // not needed
return ln.Dial()
})
req.SetURL("http://example.com")

Expand All @@ -194,7 +194,7 @@ func Test_Execute(t *testing.T) {
core, client, req := newCore(), New(), AcquireRequest()

client.SetDial(func(_ string) (net.Conn, error) {
return ln.Dial() //nolint:wrapcheck // not needed
return ln.Dial()
})
req.SetURL("http://example.com/hang-up")

Expand All @@ -208,7 +208,7 @@ func Test_Execute(t *testing.T) {
core, client, req := newCore(), New(), AcquireRequest()
client.SetTimeout(500 * time.Millisecond)
client.SetDial(func(_ string) (net.Conn, error) {
return ln.Dial() //nolint:wrapcheck // not needed
return ln.Dial()
})
req.SetURL("http://example.com/hang-up")

Expand All @@ -221,7 +221,7 @@ func Test_Execute(t *testing.T) {
core, client, req := newCore(), New(), AcquireRequest()

client.SetDial(func(_ string) (net.Conn, error) {
return ln.Dial() //nolint:wrapcheck // not needed
return ln.Dial()
})
req.SetURL("http://example.com/hang-up").
SetTimeout(300 * time.Millisecond)
Expand All @@ -236,7 +236,7 @@ func Test_Execute(t *testing.T) {
client.SetTimeout(30 * time.Millisecond)

client.SetDial(func(_ string) (net.Conn, error) {
return ln.Dial() //nolint:wrapcheck // not needed
return ln.Dial()
})
req.SetURL("http://example.com/hang-up").
SetTimeout(3000 * time.Millisecond)
Expand Down
4 changes: 2 additions & 2 deletions client/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (ts *testServer) dial() func(addr string) (net.Conn, error) {
ts.tb.Helper()

return func(_ string) (net.Conn, error) {
return ts.ln.Dial() //nolint:wrapcheck // not needed
return ts.ln.Dial()
}
}

Expand All @@ -74,7 +74,7 @@ func createHelperServer(tb testing.TB) (*fiber.App, func(addr string) (net.Conn,
app := fiber.New()

return app, func(_ string) (net.Conn, error) {
return ln.Dial() //nolint:wrapcheck // not needed
return ln.Dial()
}, func() {
require.NoError(tb, app.Listener(ln, fiber.ListenConfig{DisableStartupMessage: true}))
}
Expand Down
6 changes: 3 additions & 3 deletions client/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ func Test_Request_MaxRedirects(t *testing.T) {
t.Run("success", func(t *testing.T) {
t.Parallel()

client := New().SetDial(func(_ string) (net.Conn, error) { return ln.Dial() }) //nolint:wrapcheck // not needed
client := New().SetDial(func(_ string) (net.Conn, error) { return ln.Dial() })

resp, err := AcquireRequest().
SetClient(client).
Expand All @@ -1270,7 +1270,7 @@ func Test_Request_MaxRedirects(t *testing.T) {
t.Run("error", func(t *testing.T) {
t.Parallel()

client := New().SetDial(func(_ string) (net.Conn, error) { return ln.Dial() }) //nolint:wrapcheck // not needed
client := New().SetDial(func(_ string) (net.Conn, error) { return ln.Dial() })

resp, err := AcquireRequest().
SetClient(client).
Expand All @@ -1284,7 +1284,7 @@ func Test_Request_MaxRedirects(t *testing.T) {
t.Run("MaxRedirects", func(t *testing.T) {
t.Parallel()

client := New().SetDial(func(_ string) (net.Conn, error) { return ln.Dial() }) //nolint:wrapcheck // not needed
client := New().SetDial(func(_ string) (net.Conn, error) { return ln.Dial() })

req := AcquireRequest().
SetClient(client).
Expand Down
1 change: 0 additions & 1 deletion listen_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//nolint:wrapcheck // We must not wrap errors in tests
package fiber

import (
Expand Down
1 change: 0 additions & 1 deletion redirect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 📝 Github Repository: https://github.com/gofiber/fiber
// 📌 API Documentation: https://docs.gofiber.io

//nolint:wrapcheck // We must not wrap errors in tests
package fiber

import (
Expand Down

1 comment on commit 3209052

@ReneWerner87
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 3209052 Previous: 1607d87 Ratio
Benchmark_Etag 199.5 ns/op 0 B/op 0 allocs/op 97.85 ns/op 0 B/op 0 allocs/op 2.04
Benchmark_Middleware_Favicon 207.8 ns/op 12 B/op 4 allocs/op 88.92 ns/op 3 B/op 1 allocs/op 2.34

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.