mirror of https://github.com/gofiber/fiber.git
chore: Update golangci-lint to v1.57.1 (#2929)
* Update linter.yml * Fix issues from golangci-lint v1.57.1pull/2925/head
parent
5e8df0a348
commit
3209052305
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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}))
|
||||
}
|
||||
|
|
|
@ -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).
|
||||
|
@ -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).
|
||||
|
@ -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).
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
//nolint:wrapcheck // We must not wrap errors in tests
|
||||
package fiber
|
||||
|
||||
import (
|
||||
|
|
|
@ -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 (
|
||||
|
|
Loading…
Reference in New Issue