diff --git a/.golangci.yml b/.golangci.yml index 96a738624c..1dfa862e59 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,6 +2,7 @@ # NOTE: Keep this in sync with the version in .github/workflows/lint_golangci-lint.yml run: + timeout: 5m modules-download-mode: readonly skip-dirs-use-default: false skip-dirs: @@ -268,7 +269,7 @@ linters: - tagliatelle - tenv - testableexamples - # - testpackage # TODO: Enable once https://github.com/gofiber/fiber/issues/2252 is implemente + # - testpackage # TODO: Enable once https://github.com/gofiber/fiber/issues/2252 is implemented - thelper - tparallel - typecheck diff --git a/helpers.go b/helpers.go index 47f4e906dc..54c281cf4c 100644 --- a/helpers.go +++ b/helpers.go @@ -26,7 +26,7 @@ import ( "github.com/valyala/fasthttp" ) -// Guards overwrites to os.Stdout and Os.Stderr +// Guards overwrites to os.Stdout and os.Stderr var osStdVarMu sync.RWMutex // getTLSConfig returns a net listener's tls config diff --git a/middleware/idempotency/response.go b/middleware/idempotency/response.go index 94cec73ae4..ca06bcb452 100644 --- a/middleware/idempotency/response.go +++ b/middleware/idempotency/response.go @@ -1,5 +1,6 @@ package idempotency +//go:generate msgp -o=response_msgp.go -io=false -unexported type response struct { StatusCode int `msg:"sc"` diff --git a/prefork_test.go b/prefork_test.go index 8ef5347067..82d5e34db8 100644 --- a/prefork_test.go +++ b/prefork_test.go @@ -19,10 +19,7 @@ func Test_App_Prefork_Child_Process(t *testing.T) { // Reset test var testPreforkMaster = true - utils.AssertEqual(t, nil, os.Setenv(envPreforkChildKey, envPreforkChildVal)) - t.Cleanup(func() { - utils.AssertEqual(t, nil, os.Setenv(envPreforkChildKey, "")) - }) + t.Setenv(envPreforkChildKey, envPreforkChildVal) app := New() @@ -74,13 +71,9 @@ func Test_App_Prefork_Master_Process(t *testing.T) { dummyChildCmd.Store("") } +//nolint:paralleltest // Test is using t.Setenv which can't be run in parallel func Test_App_Prefork_Child_Process_Never_Show_Startup_Message(t *testing.T) { - t.Parallel() - - utils.AssertEqual(t, nil, os.Setenv(envPreforkChildKey, envPreforkChildVal)) - t.Cleanup(func() { - utils.AssertEqual(t, nil, os.Setenv(envPreforkChildKey, "")) - }) + t.Setenv(envPreforkChildKey, envPreforkChildVal) rescueStdout := os.Stdout defer func() { os.Stdout = rescueStdout }() //nolint:reassign // Must do this inside the test