-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/internal/typesinternal/: regression inside v0.19.0 related to ReceiverNamed #66259
Comments
The problem comes from here: func ReceiverNamed(recv *types.Var) (isPtr bool, named *types.Named) { // <---
t := recv.Type()
if ptr, ok := aliases.Unalias(t).(*types.Pointer); ok {
isPtr = true
t = ptr.Elem()
}
named, _ = aliases.Unalias(t).(*types.Named) // <---
return
} If I replace the call to this function inside func ReceiverNamedTemp(recv *types.Var) (isPtr bool, named types.Type) {
t := recv.Type()
if ptr, ok := aliases.Unalias(t).(*types.Pointer); ok {
isPtr = true
t = ptr.Elem()
}
named, ok := aliases.Unalias(t).(*types.Named)
if !ok {
named = aliases.Unalias(t)
}
return
} The problem disappears. The type assertion, inside https://go.dev/play/p/woJnLMGAgdR package typesinternal
import (
"fmt"
"go/token"
"go/types"
"testing"
"golang.org/x/tools/internal/aliases"
)
func Test_ReceiverNamed(t *testing.T) {
v := types.NewVar(token.NoPos, nil, "", types.NewPointer(types.NewArray(types.Typ[types.Int], 10)))
ptr, named := ReceiverNamed(v)
println(ptr)
fmt.Printf("%T\n", named)
// true
// *types.Named
_, ok := aliases.Unalias(named).(*types.Named)
println(ok)
// true
}
func Test_ReceiverNamedTemp(t *testing.T) {
v := types.NewVar(token.NoPos, nil, "", types.NewPointer(types.NewArray(types.Typ[types.Int], 10)))
ptr, named := ReceiverNamedTemp(v)
println(ptr)
fmt.Printf("%T\n", named)
// true
// *types.Array
_, ok := aliases.Unalias(named).(*types.Named)
println(ok)
// false
}
func ReceiverNamedTemp(recv *types.Var) (isPtr bool, named types.Type) {
t := recv.Type()
if ptr, ok := aliases.Unalias(t).(*types.Pointer); ok {
isPtr = true
t = ptr.Elem()
}
named, ok := aliases.Unalias(t).(*types.Named)
if !ok {
named = aliases.Unalias(t)
}
return
} The problem affects at least |
The problem is the function itself because it's designed to return a |
It's a critical problem for, at least, us (golangci-lint maintainers) and, I think, for I cannot downgrade because some dependencies already use v0.19.0 and I cannot use I will postpone the release of golangci-lint for now. I am interested in creating a fix, but I think this should be discussed before doing something. |
If If this is the case, the desired solution is probably to audit the users of the function. Not update the signature. |
I think you suggest that the root of the problem is not here, but at least, the expectations of the function seem optimistic about the type. |
I compiled the $ go vet -vettool=unitchecker ./tools/cmd/debug/...
# gitlab.com/accumulatenetwork/accumulate/tools/cmd/debug
# [gitlab.com/accumulatenetwork/accumulate/tools/cmd/debug]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x68c589]
goroutine 53 [running]:
go/types.(*Named).Obj(...)
/usr/lib/go/src/go/types/named.go:295
golang.org/x/tools/go/analysis/passes/internal/analysisutil.IsNamedType({0x7b6958?, 0x0?}, {0x73cd99, 0x8}, {0xc002718a48, 0x1, 0x10?})
../../golangci-lint/x-tools/go/analysis/passes/internal/analysisutil/util.go:123 +0x49
golang.org/x/tools/go/analysis/passes/httpresponse.isHTTPFuncOrMethodOnClient(0xc00051ce40, 0xc002718af0?)
../../golangci-lint/x-tools/go/analysis/passes/httpresponse/httpresponse.go:122 +0xfb
golang.org/x/tools/go/analysis/passes/httpresponse.run.func1({0x7b6548?, 0xc0003b3800?}, 0x18?, {0xc002d4e000, 0x5, 0x20})
../../golangci-lint/x-tools/go/analysis/passes/httpresponse/httpresponse.go:62 +0x73
golang.org/x/tools/go/ast/inspector.(*Inspector).WithStack(0xc0025e96b0, {0xc002718c08?, 0x9688e0?, 0xc000600008?}, 0xc002718c18)
../../golangci-lint/x-tools/go/ast/inspector/inspector.go:148 +0x188
golang.org/x/tools/go/analysis/passes/httpresponse.run(0xc002d3a0d0)
../../golangci-lint/x-tools/go/analysis/passes/httpresponse/httpresponse.go:57 +0x112
golang.org/x/tools/go/analysis/unitchecker.run.func2.1()
../../golangci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:382 +0x8ce
sync.(*Once).doSlow(0x6edb40?, 0xc001f72ff0?)
/usr/lib/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/usr/lib/go/src/sync/once.go:65
golang.org/x/tools/go/analysis/unitchecker.run.func2(0x9676e0)
../../golangci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:333 +0x19e
golang.org/x/tools/go/analysis/unitchecker.run.func3.1(0x0?)
../../golangci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:404 +0x23
created by golang.org/x/tools/go/analysis/unitchecker.run.func3 in goroutine 1
../../golangci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:403 +0x4 |
Change https://go.dev/cl/571057 mentions this issue: |
A minimal reproducer
package main
import (
"net/http"
"github.com/golangci/sandbox/pkg"
)
func Bar(_ *http.Server) {
pkg.ChainFromJSON()
}
package pkg
func ChainFromJSON() (*[32]byte, error) {
return nil, nil
} $ go vet -vettool=unitchecker .
# github.com/golangci/sandbox
# [github.com/golangci/sandbox]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x68c649]
goroutine 55 [running]:
go/types.(*Named).Obj(...)
/usr/lib/go/src/go/types/named.go:295
golang.org/x/tools/go/analysis/passes/internal/analysisutil.IsNamedType({0x7b6978?, 0x0?}, {0x73cd9d, 0x8}, {0xc0000a2a48, 0x1, 0x10?})
../../../..langci-lint/x-tools/go/analysis/passes/internal/analysisutil/util.go:129 +0x49
golang.org/x/tools/go/analysis/passes/httpresponse.isHTTPFuncOrMethodOnClient(0xc0000005b0, 0xc0000a2af0?)
../../../..langci-lint/x-tools/go/analysis/passes/httpresponse/httpresponse.go:139 +0xff
golang.org/x/tools/go/analysis/passes/httpresponse.run.func1({0x7b6568?, 0xc0001d2e40?}, 0x18?, {0xc00003a100, 0x5, 0x8})
../../../..langci-lint/x-tools/go/analysis/passes/httpresponse/httpresponse.go:65 +0x6f
golang.org/x/tools/go/ast/inspector.(*Inspector).WithStack(0xc0003b04c8, {0xc0000a2c08?, 0x9688e0?, 0xc000700008?}, 0xc0000a2c18)
../../../..langci-lint/x-tools/go/ast/inspector/inspector.go:148 +0x188
golang.org/x/tools/go/analysis/passes/httpresponse.run(0xc0000005b0)
../../../..langci-lint/x-tools/go/analysis/passes/httpresponse/httpresponse.go:57 +0x112
golang.org/x/tools/go/analysis/unitchecker.run.func2.1()
../../../..langci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:382 +0x8ce
sync.(*Once).doSlow(0x6edb40?, 0xc0003bb230?)
/usr/lib/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/usr/lib/go/src/sync/once.go:65
golang.org/x/tools/go/analysis/unitchecker.run.func2(0x9676e0)
../../../..langci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:333 +0x19e
golang.org/x/tools/go/analysis/unitchecker.run.func3.1(0x0?)
../../../..langci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:404 +0x23
created by golang.org/x/tools/go/analysis/unitchecker.run.func3 in goroutine 1
../../../..langci-lint/x-tools/go/analysis/unitchecker/unitchecker.go:403 +0x47
Maybe you will be able to use it inside a test. |
It looks like a bug that comes from somewhere else because the type of the return parameter depends on the position of the function:
Maybe I missed something but it's an unexpected behavior. |
I can reproduce the stack trace for Do you have stack traces for |
My assumptions were only based on the successive call to But now, I think that only
Not sure if you are interested in it but the problem happened on:
This is what I call "unnamed". |
[](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci-lint](https://togithub.com/golangci/golangci-lint) | minor | `1.56.2` -> `1.57.1` | --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci-lint)</summary> ### [`v1.57.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) 1. Fixes: - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) 1. New linters - `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar - `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters - `dupword`: from 0.0.13 to 0.0.14 - `gci`: from 0.12.1 to 0.12.3 - `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) - `go-critic`: from 0.11.1 to 0.11.2 - `go-critic`: support of `enable-all` and `disable-all` options - `go-spancheck`: from 0.5.2 to 0.5.3 - `gomodguard`: from 1.3.0 to 1.3.1 - `govet`: deprecation of `check-shadowing`⚠️ - `govet`: disable temporarily `httpresponse` because of a bug [https://github.com/golang/go/issues/66259](https://togithub.com/golang/go/issues/66259) - `misspell`: add `extra-words` - `musttag`: from 0.8.0 to 0.9.0 - `nakedret`: from 2.0.2 to 2.0.4 - `paralleltest`: from 1.0.9 to 1.0.10 - `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) - `protogetter`: from 0.3.4 to 0.3.5 - `revive`: add `exclude` option - `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) - `staticcheck`: from 0.4.6 to 0.4.7 - `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) - `unconvert`: to HEAD (new options `fast-math` and `safe`) - `wrapcheck`: from 2.8.1 to 2.8.3 - Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements - 🧩 New custom linters system https://golangci-lint.run/plugins/module-plugins/ - 🎉 Allow running only a specific linter without modifying the file configuration (`--enable-only`) - Allow custom sort order for the reports (`output.sort-order`) - Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` - Add `verify` command to check the configuration against the JSON Schema - Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) - Syntax to not override `severity` from linters (`@linter`) - Use severities from `gosec` - Create automatically directory related to `output.formats.path` - Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. -⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) -⚠️ Deprecated CLI flags have been removed (deprecated since 2018) -⚠️ Move `show-stats` option from `run` to `output` configuration section -⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options -⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax - Internal rewrite of the CLI - Improve 'no go files to analyze' message - Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation -⚠️ Define the linter deprecation cycle https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle - 🎉 Use information from the previous release to create linter pages - 🎉 Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json - Reorganize documentation pages - Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important⚠️ ** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/TBD54566975/scaffolder). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://togithub.com/golangci/golangci-lint) | minor | `v1.56.2` -> `v1.57.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci/golangci-lint)</summary> ### [`v1.57.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.1...v1.57.2) 1. Updated linters - `contextcheck`: from 1.1.4 to 1.1.5 - `copyloopvar`: from 1.0.8 to 1.0.10 - `ginkgolinter`: from 0.16.1 to 0.16.2 - `goconst`: from 1.7.0 to 1.7.1 - `gomoddirectives`: from 0.2.3 to 0.2.4 - `intrange`: from 0.1.0 to 0.1.1 2. Misc. - fix: display warnings on deprecated linter options - fix: missing `colored-tab` output format - fix: TeamCity `inspectionType` service message 3. Documentation - Remove invalid example about mixing files and directory - Improve linters page ### [`v1.57.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.0...v1.57.1) 1. Fixes: - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.2...v1.57.0) 1. New linters - `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar - `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters - `dupword`: from 0.0.13 to 0.0.14 - `gci`: from 0.12.1 to 0.12.3 - `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) - `go-critic`: from 0.11.1 to 0.11.2 - `go-critic`: support of `enable-all` and `disable-all` options - `go-spancheck`: from 0.5.2 to 0.5.3 - `gomodguard`: from 1.3.0 to 1.3.1 - `govet`: deprecation of `check-shadowing`⚠️ - `govet`: disable temporarily `httpresponse` because of a bug [https://github.com/golang/go/issues/66259](https://togithub.com/golang/go/issues/66259) - `misspell`: add `extra-words` - `musttag`: from 0.8.0 to 0.9.0 - `nakedret`: from 2.0.2 to 2.0.4 - `paralleltest`: from 1.0.9 to 1.0.10 - `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) - `protogetter`: from 0.3.4 to 0.3.5 - `revive`: add `exclude` option - `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) - `staticcheck`: from 0.4.6 to 0.4.7 - `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) - `unconvert`: to HEAD (new options `fast-math` and `safe`) - `wrapcheck`: from 2.8.1 to 2.8.3 - Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements - 🧩 New custom linters system https://golangci-lint.run/plugins/module-plugins/ - 🎉 Allow running only a specific linter without modifying the file configuration (`--enable-only`) - Allow custom sort order for the reports (`output.sort-order`) - Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` - Add `verify` command to check the configuration against the JSON Schema - Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) - Syntax to not override `severity` from linters (`@linter`) - Use severities from `gosec` - Create automatically directory related to `output.formats.path` - Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. -⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) -⚠️ Deprecated CLI flags have been removed (deprecated since 2018) -⚠️ Move `show-stats` option from `run` to `output` configuration section -⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options -⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax - Internal rewrite of the CLI - Improve 'no go files to analyze' message - Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation -⚠️ Define the linter deprecation cycle https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle - 🎉 Use information from the previous release to create linter pages - 🎉 Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json - Reorganize documentation pages - Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important⚠️ ** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://togithub.com/golangci/golangci-lint) | minor | `v1.56.2` -> `v1.57.2` | --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci/golangci-lint)</summary> ### [`v1.57.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.1...v1.57.2) 1. Updated linters - `contextcheck`: from 1.1.4 to 1.1.5 - `copyloopvar`: from 1.0.8 to 1.0.10 - `ginkgolinter`: from 0.16.1 to 0.16.2 - `goconst`: from 1.7.0 to 1.7.1 - `gomoddirectives`: from 0.2.3 to 0.2.4 - `intrange`: from 0.1.0 to 0.1.1 2. Misc. - fix: display warnings on deprecated linter options - fix: missing `colored-tab` output format - fix: TeamCity `inspectionType` service message 3. Documentation - Remove invalid example about mixing files and directory - Improve linters page ### [`v1.57.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.0...v1.57.1) 1. Fixes: - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.2...v1.57.0) 1. New linters - `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar - `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters - `dupword`: from 0.0.13 to 0.0.14 - `gci`: from 0.12.1 to 0.12.3 - `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) - `go-critic`: from 0.11.1 to 0.11.2 - `go-critic`: support of `enable-all` and `disable-all` options - `go-spancheck`: from 0.5.2 to 0.5.3 - `gomodguard`: from 1.3.0 to 1.3.1 - `govet`: deprecation of `check-shadowing`⚠️ - `govet`: disable temporarily `httpresponse` because of a bug [https://github.com/golang/go/issues/66259](https://togithub.com/golang/go/issues/66259) - `misspell`: add `extra-words` - `musttag`: from 0.8.0 to 0.9.0 - `nakedret`: from 2.0.2 to 2.0.4 - `paralleltest`: from 1.0.9 to 1.0.10 - `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) - `protogetter`: from 0.3.4 to 0.3.5 - `revive`: add `exclude` option - `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) - `staticcheck`: from 0.4.6 to 0.4.7 - `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) - `unconvert`: to HEAD (new options `fast-math` and `safe`) - `wrapcheck`: from 2.8.1 to 2.8.3 - Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements - 🧩 New custom linters system https://golangci-lint.run/plugins/module-plugins/ - 🎉 Allow running only a specific linter without modifying the file configuration (`--enable-only`) - Allow custom sort order for the reports (`output.sort-order`) - Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` - Add `verify` command to check the configuration against the JSON Schema - Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) - Syntax to not override `severity` from linters (`@linter`) - Use severities from `gosec` - Create automatically directory related to `output.formats.path` - Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. -⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) -⚠️ Deprecated CLI flags have been removed (deprecated since 2018) -⚠️ Move `show-stats` option from `run` to `output` configuration section -⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options -⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax - Internal rewrite of the CLI - Improve 'no go files to analyze' message - Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation -⚠️ Define the linter deprecation cycle https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle - 🎉 Use information from the previous release to create linter pages - 🎉 Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json - Reorganize documentation pages - Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important⚠️ ** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://togithub.com/golangci/golangci-lint) | minor | `v1.56.2` -> `v1.57.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci/golangci-lint)</summary> ### [`v1.57.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.1...v1.57.2) 1. Updated linters - `contextcheck`: from 1.1.4 to 1.1.5 - `copyloopvar`: from 1.0.8 to 1.0.10 - `ginkgolinter`: from 0.16.1 to 0.16.2 - `goconst`: from 1.7.0 to 1.7.1 - `gomoddirectives`: from 0.2.3 to 0.2.4 - `intrange`: from 0.1.0 to 0.1.1 2. Misc. - fix: display warnings on deprecated linter options - fix: missing `colored-tab` output format - fix: TeamCity `inspectionType` service message 3. Documentation - Remove invalid example about mixing files and directory - Improve linters page ### [`v1.57.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.0...v1.57.1) 1. Fixes: - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.2...v1.57.0) 1. New linters - `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar - `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters - `dupword`: from 0.0.13 to 0.0.14 - `gci`: from 0.12.1 to 0.12.3 - `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) - `go-critic`: from 0.11.1 to 0.11.2 - `go-critic`: support of `enable-all` and `disable-all` options - `go-spancheck`: from 0.5.2 to 0.5.3 - `gomodguard`: from 1.3.0 to 1.3.1 - `govet`: deprecation of `check-shadowing`⚠️ - `govet`: disable temporarily `httpresponse` because of a bug [https://github.com/golang/go/issues/66259](https://togithub.com/golang/go/issues/66259) - `misspell`: add `extra-words` - `musttag`: from 0.8.0 to 0.9.0 - `nakedret`: from 2.0.2 to 2.0.4 - `paralleltest`: from 1.0.9 to 1.0.10 - `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) - `protogetter`: from 0.3.4 to 0.3.5 - `revive`: add `exclude` option - `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) - `staticcheck`: from 0.4.6 to 0.4.7 - `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) - `unconvert`: to HEAD (new options `fast-math` and `safe`) - `wrapcheck`: from 2.8.1 to 2.8.3 - Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements - 🧩 New custom linters system https://golangci-lint.run/plugins/module-plugins/ - 🎉 Allow running only a specific linter without modifying the file configuration (`--enable-only`) - Allow custom sort order for the reports (`output.sort-order`) - Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` - Add `verify` command to check the configuration against the JSON Schema - Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) - Syntax to not override `severity` from linters (`@linter`) - Use severities from `gosec` - Create automatically directory related to `output.formats.path` - Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. -⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) -⚠️ Deprecated CLI flags have been removed (deprecated since 2018) -⚠️ Move `show-stats` option from `run` to `output` configuration section -⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options -⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax - Internal rewrite of the CLI - Improve 'no go files to analyze' message - Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation -⚠️ Define the linter deprecation cycle https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle - 🎉 Use information from the previous release to create linter pages - 🎉 Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json - Reorganize documentation pages - Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important⚠️ ** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://togithub.com/golangci/golangci-lint) | minor | `v1.55.2` -> `v1.57.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci/golangci-lint)</summary> ### [`v1.57.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.1...v1.57.2) 1. Updated linters - `contextcheck`: from 1.1.4 to 1.1.5 - `copyloopvar`: from 1.0.8 to 1.0.10 - `ginkgolinter`: from 0.16.1 to 0.16.2 - `goconst`: from 1.7.0 to 1.7.1 - `gomoddirectives`: from 0.2.3 to 0.2.4 - `intrange`: from 0.1.0 to 0.1.1 2. Misc. - fix: display warnings on deprecated linter options - fix: missing `colored-tab` output format - fix: TeamCity `inspectionType` service message 3. Documentation - Remove invalid example about mixing files and directory - Improve linters page ### [`v1.57.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.0...v1.57.1) 1. Fixes: - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.2...v1.57.0) 1. New linters - `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar - `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters - `dupword`: from 0.0.13 to 0.0.14 - `gci`: from 0.12.1 to 0.12.3 - `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) - `go-critic`: from 0.11.1 to 0.11.2 - `go-critic`: support of `enable-all` and `disable-all` options - `go-spancheck`: from 0.5.2 to 0.5.3 - `gomodguard`: from 1.3.0 to 1.3.1 - `govet`: deprecation of `check-shadowing`⚠️ - `govet`: disable temporarily `httpresponse` because of a bug [https://github.com/golang/go/issues/66259](https://togithub.com/golang/go/issues/66259) - `misspell`: add `extra-words` - `musttag`: from 0.8.0 to 0.9.0 - `nakedret`: from 2.0.2 to 2.0.4 - `paralleltest`: from 1.0.9 to 1.0.10 - `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) - `protogetter`: from 0.3.4 to 0.3.5 - `revive`: add `exclude` option - `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) - `staticcheck`: from 0.4.6 to 0.4.7 - `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) - `unconvert`: to HEAD (new options `fast-math` and `safe`) - `wrapcheck`: from 2.8.1 to 2.8.3 - Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements - 🧩 New custom linters system https://golangci-lint.run/plugins/module-plugins/ - 🎉 Allow running only a specific linter without modifying the file configuration (`--enable-only`) - Allow custom sort order for the reports (`output.sort-order`) - Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` - Add `verify` command to check the configuration against the JSON Schema - Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) - Syntax to not override `severity` from linters (`@linter`) - Use severities from `gosec` - Create automatically directory related to `output.formats.path` - Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. -⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) -⚠️ Deprecated CLI flags have been removed (deprecated since 2018) -⚠️ Move `show-stats` option from `run` to `output` configuration section -⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options -⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax - Internal rewrite of the CLI - Improve 'no go files to analyze' message - Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation -⚠️ Define the linter deprecation cycle https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle - 🎉 Use information from the previous release to create linter pages - 🎉 Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json - Reorganize documentation pages - Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important⚠️ ** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. ### [`v1.56.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1562) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.1...v1.56.2) 1. updated linters - `go-critic`: from 0.11.0 to 0.11.1 - `gosec`: from 2.18.2 to 2.19.0 - `testifylint`: from 1.1.1 to 1.1.2 - `usestdlibvars`: from 1.24.0 to 1.25.0 - `wsl`: from 4.2.0 to 4.2.1 2. misc. - Fix missing version in Docker image 3. Documentation - Explain the limitation of `new-from-rev` and `new-from-patch` ### [`v1.56.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1561) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.0...v1.56.1) 1. updated linters - `errcheck`: from 1.6.3 to 1.7.0 - `govet`: disable `loopclosure` with go1.22 - `revive`: from 1.3.6 to 1.3.7 - `testifylint`: from 1.1.0 to 1.1.1 ### [`v1.56.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1560) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.55.2...v1.56.0) 1. new linters - `spancheck`: https://github.com/jjti/go-spancheck 2. updated linters - `depguard`: from 2.1.0 to 2.2.0 - `exhaustive`: from 0.11.0 to 0.12.0 - `exhaustruct`: from 3.1.0 to 3.2.0 - `gci`: from 0.11.2 to 0.12.1 - `ginkgolinter`: from 0.14.1 to 0.15.2 - `go-check-sumtype`: from 0.1.3 to 0.1.4 - `go-critic`: from 0.9.0 to 0.11.0 - `go-errorlint`: from 1.4.5 to 1.4.8 - `go-spancheck`: from 0.4.2 to 0.5.2 - `goconst`: from 1.6.0 to 1.7.0 - `godot`: from 1.4.15 to 1.4.16 - `gofumpt`: from 0.5.0 to 0.6.0 - `inamedparam`: from 0.1.2 to 0.1.3 - `ineffassign`: from 0.0.0-20230610083614-0e73809eb601 to 0.1.0 - `ireturn`: from 0.2.2 to 0.3.0 - `misspell`: add mode option - `musttag`: from v0.7.2 to v0.8.0 - `paralleltest`: from 1.0.8 to 1.0.9 - `perfsprint`: from 0.2.0 to 0.6.0 - `protogetter`: from 0.2.3 to 0.3.4 - `revive`: from 1.3.4 to 1.3.6 - `sloglint`: add static-msg option - `sloglint`: from 0.1.2 to 0.4.0 - `testifylint`: from 0.2.3 to 1.1.0 - `unparam`: from [`2022122`](https://togithub.com/golangci/golangci-lint/commit/20221223090309)-7455f1af531d to [`2024010`](https://togithub.com/golangci/golangci-lint/commit/20240104100049)-c549a3470d14 - `whitespace`: update after moving to the `analysis` package - `wsl`: from 3.4.0 to 4.2.0 - `zerologlint`: from 0.1.3 to 0.1.5 3. misc. - 🎉 go1.22 support - Implement stats per linter with a flag - Make versioning inside Docker image consistent with binaries - Parse Go RC version 4. Documentation - Fix `noctx` description - Add missing fields to `.golangci.reference.yml` - Improve `.golangci.reference.yml` defaults - `typecheck`: improve FAQ - `exhaustruct`: note that struct regular expressions are expected to match the entire `package/name/structname` - `wrapcheck`: adjust `ignoreSigs` to new defaults **Important** `testifylint` has [breaking changes](https://togithub.com/Antonboom/testifylint/releases/tag/v1.0.0) about enabling/disabling checks: - If you were using the option `enable` with a filtered list of checks, you should either add `disable-all: true` (1) or use `disable` field (2). ```yml ``` ### Example (1) testifylint: disable-all: true enable: - bool-compare - compares - empty - error-is-as - error-nil - expected-actual - go-require - float-compare - len - nil-compare - require-error ### - suite-dont-use-pkg - suite-extra-assert-call - suite-thelper ``` ```yml ### Example (2) testifylint: disable: - suite-dont-use-pkg ``` </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
[](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci-lint](https://togithub.com/golangci/golangci-lint) | minor | `1.54.2` -> `1.58.0` | --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci-lint)</summary> ### [`v1.58.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1580) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.2...v1.58.0) 1. New linters - `fatcontext`: https://github.com/Crocmagnon/fatcontext - `canonicalheader`: https://github.com/lasiar/canonicalheader 2. Updated linters - `copyloopvar`: from 1.0.10 to 1.1.0 (`ignore-alias` is replaced by `check-alias` with the opposite behavior) - `decorder`: from 0.4.1 to 0.4.2 - `errname`: from 0.1.12 to 0.1.13 - `errorlint`: from 1.4.8 to 1.5.1 (new options `allowed-errors` and `allowed-errors-wildcard`) - `execinquery`: deprecate linter⚠️ - `gci`: from 0.12.3 to 0.13.4 (new section `localModule`) - `gocritic`: from 0.11.2 to 0.11.3 - `spancheck`: from 0.5.3 to 0.6.1 - `goerr113` is replaced by `err113`⚠️ - `gomnd` is replaced by `mnd`⚠️ - `gomodguard`: from 1.3.1 to 1.3.2 - `grouper`: from 1.1.1 to 1.1.2 - `intrange`: from 0.1.1 to 0.1.2 - `mirror`: from 1.1.0 to 1.2.0 - `misspell`: from 0.4.1 to 0.5.1 - `musttag`: from 0.9.0 to 0.12.1 - `nilnil`: from 0.1.7 to 0.1.8 - `nonamedreturns`: from 1.0.4 to 1.0.5 - `promlinter`: from 0.2.0 to 0.3.0 - `sloglint`: from 0.5.0 to 0.6.0 - `unparam`: bump to HEAD ([`063aff9`](https://togithub.com/golangci/golangci-lint/commit/063aff900ca150b80930c8de76f11d7e6488222f)) - `whitespace`: from 0.1.0 to 0.1.1 3. Enhancements - Speed up "fast" linters when only "fast" linters are run: between 40% and 80% faster at first run (i.e. without cache) 4. Fixes - Use version with module plugins - Skip `go.mod` report inside autogenerated processor - Keep only `typecheck` issues when needed - Don't hide `typecheck` errors inside diff processor 5. Misc. -⚠️ log an error when using previously deprecated linters ([Linter Deprecation Cycle](https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle)) - [`deadcode`](https://togithub.com/remyoudompheng/go-misc/tree/master/deadcode): deprecated since v1.49.0 (2022-08-23). - [`exhaustivestruct`](https://togithub.com/mbilski/exhaustivestruct): deprecated since v1.46.0 (2022-05-08). - [`golint`](https://togithub.com/golang/lint): deprecated since v1.41.0 (2021-06-15). - [`ifshort`](https://togithub.com/esimonov/ifshort): deprecated since v1.48.0 (2022-08-04). - [`interfacer`](https://togithub.com/mvdan/interfacer): deprecated since v1.38.0 (2021-03-03). - [`maligned`](https://togithub.com/mdempsky/maligned): deprecated since v1.38.0 (2021-03-03). - [`nosnakecase`](https://togithub.com/sivchari/nosnakecase): deprecated since v1.48.0 (2022-08-04). - [`scopelint`](https://togithub.com/kyoh86/scopelint): deprecated since v1.39.0 (2021-03-25). - [`structcheck`](https://togithub.com/opennota/check): deprecated since v1.49.0 (2022-08-23). - [`varcheck`](https://togithub.com/opennota/check): deprecated since v1.49.0 (2022-08-23). -⚠️ Deprecate usage of linter alternative names - Remove help display on errors with `config verify` command - Add `pre-commit` hook to run `config verify` - Improve `github-action` output 6. Documentation - docs: remove deprecated Atom from Editor Integrations GitHub Action (v5.1.0) for golangci-lint: - supports for `pull`, `pull_request_target`, and `merge_group` events with the option `only-new-issues`. - ️️⚠️ `skip-pkg-cache` and `skip-build-cache` have been removed because the cache related to Go itself is already handled by `actions/setup-go`. - with golangci-lint v1.58, the file information (path and position) will be displayed on the log. ### [`v1.57.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.1...v1.57.2) 1. Updated linters - `contextcheck`: from 1.1.4 to 1.1.5 - `copyloopvar`: from 1.0.8 to 1.0.10 - `ginkgolinter`: from 0.16.1 to 0.16.2 - `goconst`: from 1.7.0 to 1.7.1 - `gomoddirectives`: from 0.2.3 to 0.2.4 - `intrange`: from 0.1.0 to 0.1.1 2. Misc. - fix: display warnings on deprecated linter options - fix: missing `colored-tab` output format - fix: TeamCity `inspectionType` service message 3. Documentation - Remove invalid example about mixing files and directory - Improve linters page ### [`v1.57.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.57.0...v1.57.1) 1. Fixes: - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.2...v1.57.0) 1. New linters - `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar - `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters - `dupword`: from 0.0.13 to 0.0.14 - `gci`: from 0.12.1 to 0.12.3 - `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) - `go-critic`: from 0.11.1 to 0.11.2 - `go-critic`: support of `enable-all` and `disable-all` options - `go-spancheck`: from 0.5.2 to 0.5.3 - `gomodguard`: from 1.3.0 to 1.3.1 - `govet`: deprecation of `check-shadowing`⚠️ - `govet`: disable temporarily `httpresponse` because of a bug [https://github.com/golang/go/issues/66259](https://togithub.com/golang/go/issues/66259) - `misspell`: add `extra-words` - `musttag`: from 0.8.0 to 0.9.0 - `nakedret`: from 2.0.2 to 2.0.4 - `paralleltest`: from 1.0.9 to 1.0.10 - `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) - `protogetter`: from 0.3.4 to 0.3.5 - `revive`: add `exclude` option - `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) - `staticcheck`: from 0.4.6 to 0.4.7 - `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) - `unconvert`: to HEAD (new options `fast-math` and `safe`) - `wrapcheck`: from 2.8.1 to 2.8.3 - Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements - 🧩 New custom linters system https://golangci-lint.run/plugins/module-plugins/ - 🎉 Allow running only a specific linter without modifying the file configuration (`--enable-only`) - Allow custom sort order for the reports (`output.sort-order`) - Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` - Add `verify` command to check the configuration against the JSON Schema - Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) - Syntax to not override `severity` from linters (`@linter`) - Use severities from `gosec` - Create automatically directory related to `output.formats.path` - Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. -⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) -⚠️ Deprecated CLI flags have been removed (deprecated since 2018) -⚠️ Move `show-stats` option from `run` to `output` configuration section -⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options -⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax - Internal rewrite of the CLI - Improve 'no go files to analyze' message - Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation -⚠️ Define the linter deprecation cycle https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle - 🎉 Use information from the previous release to create linter pages - 🎉 Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json - Reorganize documentation pages - Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important⚠️ ** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. ### [`v1.56.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1562) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.1...v1.56.2) 1. updated linters - `go-critic`: from 0.11.0 to 0.11.1 - `gosec`: from 2.18.2 to 2.19.0 - `testifylint`: from 1.1.1 to 1.1.2 - `usestdlibvars`: from 1.24.0 to 1.25.0 - `wsl`: from 4.2.0 to 4.2.1 2. misc. - Fix missing version in Docker image 3. Documentation - Explain the limitation of `new-from-rev` and `new-from-patch` ### [`v1.56.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1561) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.0...v1.56.1) 1. updated linters - `errcheck`: from 1.6.3 to 1.7.0 - `govet`: disable `loopclosure` with go1.22 - `revive`: from 1.3.6 to 1.3.7 - `testifylint`: from 1.1.0 to 1.1.1 ### [`v1.56.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1560) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.55.2...v1.56.0) 1. new linters - `spancheck`: https://github.com/jjti/go-spancheck 2. updated linters - `depguard`: from 2.1.0 to 2.2.0 - `exhaustive`: from 0.11.0 to 0.12.0 - `exhaustruct`: from 3.1.0 to 3.2.0 - `gci`: from 0.11.2 to 0.12.1 - `ginkgolinter`: from 0.14.1 to 0.15.2 - `go-check-sumtype`: from 0.1.3 to 0.1.4 - `go-critic`: from 0.9.0 to 0.11.0 - `go-errorlint`: from 1.4.5 to 1.4.8 - `go-spancheck`: from 0.4.2 to 0.5.2 - `goconst`: from 1.6.0 to 1.7.0 - `godot`: from 1.4.15 to 1.4.16 - `gofumpt`: from 0.5.0 to 0.6.0 - `inamedparam`: from 0.1.2 to 0.1.3 - `ineffassign`: from 0.0.0-20230610083614-0e73809eb601 to 0.1.0 - `ireturn`: from 0.2.2 to 0.3.0 - `misspell`: add mode option - `musttag`: from v0.7.2 to v0.8.0 - `paralleltest`: from 1.0.8 to 1.0.9 - `perfsprint`: from 0.2.0 to 0.6.0 - `protogetter`: from 0.2.3 to 0.3.4 - `revive`: from 1.3.4 to 1.3.6 - `sloglint`: add static-msg option - `sloglint`: from 0.1.2 to 0.4.0 - `testifylint`: from 0.2.3 to 1.1.0 - `unparam`: from [`2022122`](https://togithub.com/golangci/golangci-lint/commit/20221223090309)-7455f1af531d to [`2024010`](https://togithub.com/golangci/golangci-lint/commit/20240104100049)-c549a3470d14 - `whitespace`: update after moving to the `analysis` package - `wsl`: from 3.4.0 to 4.2.0 - `zerologlint`: from 0.1.3 to 0.1.5 3. misc. - 🎉 go1.22 support - Implement stats per linter with a flag - Make versioning inside Docker image consistent with binaries - Parse Go RC version 4. Documentation - Fix `noctx` description - Add missing fields to `.golangci.reference.yml` - Improve `.golangci.reference.yml` defaults - `typecheck`: improve FAQ - `exhaustruct`: note that struct regular expressions are expected to match the entire `package/name/structname` - `wrapcheck`: adjust `ignoreSigs` to new defaults **Important** `testifylint` has [breaking changes](https://togithub.com/Antonboom/testifylint/releases/tag/v1.0.0) about enabling/disabling checks: - If you were using the option `enable` with a filtered list of checks, you should either add `disable-all: true` (1) or use `disable` field (2). ```yml ``` ### Example (1) testifylint: disable-all: true enable: - bool-compare - compares - empty - error-is-as - error-nil - expected-actual - go-require - float-compare - len - nil-compare - require-error ### - suite-dont-use-pkg - suite-extra-assert-call - suite-thelper ``` ```yml ### Example (2) testifylint: disable: - suite-dont-use-pkg ``` ### [`v1.55.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1552) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.55.1...v1.55.2) 1. updated linters - `ireturn`: from 0.2.1 to 0.2.2 - `ginkgolinter`: from 0.14.0 to 0.14.1 ### [`v1.55.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1551) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.55.0...v1.55.1) 1. updated linters - `gosec`: from 2.18.1 to 2.18.2 2. misc. - `revgrep`: from v0.5.0 to v0.5.2 (support git < 2.41.0) - output: convert backslashes to forward slashes for GitHub Action annotations printer ### [`v1.55.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1550) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.54.2...v1.55.0) 1. new linters - `gochecksumtype`: https://github.com/alecthomas/go-check-sumtype - `inamedparam`: https://github.com/macabu/inamedparam - `perfsprint`: https://github.com/catenacyber/perfsprint - `protogetter`: https://github.com/ghostiam/protogetter - `sloglint`: https://github.com/go-simpler/sloglint - `testifylint`: https://github.com/Antonboom/testifylint 2. updated linters - `bidichk`: from 0.2.4 to 0.2.7 - `decorder`: from 0.4.0 to 0.4.1 - `dupword`: from 0.0.12 to 0.0.13 - `errchkjson`: from 0.3.1 to 0.3.6 - `gci`: from 0.11.0 to 0.11.2 - `ginkgolinter`: from 0.13.5 to 0.14.0 - `go-errorlint`: from 1.4.4 to 1.4.5 - `gocognit`: from 1.0.7 to 1.1.0 - `goconst`: from 1.5.1 to 1.6.0 - `godot`: from 1.4.14 to 1.4.15 - `gofmt`: update to HEAD - `goimports`: update to HEAD - `gosec`: from 2.17.0 to 2.18.1 - `gosmopolitan`: from 1.2.1 to 1.2.2 - `govet`: add `appends` analyzer - `ireturn`: from 0.2.0 to 0.2.1 - `protogetter`: from 0.2.2 to 0.2.3 - `revgrep`: from [`745bb2f`](https://togithub.com/golangci/golangci-lint/commit/745bb2f7c2e6) to v0.5.0 - `revive`: from 1.3.2 to 1.3.4 - `sqlclosecheck`: from 0.4.0 to 0.5.1 - `staticcheck`: from 0.4.5 to 0.4.6 - `tagalign`: from 1.3.2 to 1.3.3 - `unused`: support passing in options 3. misc. - Add a pre-commit hook to check all files 4. Documentation - add source options to exclude-rules docs - `gosec`: add G602 to includes/excludes inside .golangci.reference.yml </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/boatkit-io/n2k). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOS4yIiwidXBkYXRlZEluVmVyIjoiMzcuMzMxLjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | Type | Update | |---|---|---|---|---|---|---|---| | [github.com/stretchr/testify](https://togithub.com/stretchr/testify) | `v1.8.4` -> `v1.9.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | require | minor | | [go](https://togithub.com/golang/go) | `1.22.0` -> `1.22.4` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | patch | | [golangci-lint](https://togithub.com/golangci/golangci-lint) | `1.56.2` -> `1.59.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | minor | --- ### Release Notes <details> <summary>stretchr/testify (github.com/stretchr/testify)</summary> ### [`v1.9.0`](https://togithub.com/stretchr/testify/releases/tag/v1.9.0) [Compare Source](https://togithub.com/stretchr/testify/compare/v1.8.4...v1.9.0) #### What's Changed - Fix Go modules version by [@​SuperQ](https://togithub.com/SuperQ) in [https://github.com/stretchr/testify/pull/1394](https://togithub.com/stretchr/testify/pull/1394) - Document that require is not safe to call in created goroutines by [@​programmer04](https://togithub.com/programmer04) in [https://github.com/stretchr/testify/pull/1392](https://togithub.com/stretchr/testify/pull/1392) - Remove myself from MAINTAINERS.md by [@​mvdkleijn](https://togithub.com/mvdkleijn) in [https://github.com/stretchr/testify/pull/1367](https://togithub.com/stretchr/testify/pull/1367) - Correct spelling/grammar by [@​echarrod](https://togithub.com/echarrod) in [https://github.com/stretchr/testify/pull/1389](https://togithub.com/stretchr/testify/pull/1389) - docs: Update URLs in README by [@​davidjb](https://togithub.com/davidjb) in [https://github.com/stretchr/testify/pull/1349](https://togithub.com/stretchr/testify/pull/1349) - Update mockery link to Github Pages in README by [@​LandonTClipp](https://togithub.com/LandonTClipp) in [https://github.com/stretchr/testify/pull/1346](https://togithub.com/stretchr/testify/pull/1346) - docs: Fix typos in tests and comments by [@​alexandear](https://togithub.com/alexandear) in [https://github.com/stretchr/testify/pull/1410](https://togithub.com/stretchr/testify/pull/1410) - CI: tests from go1.17 by [@​SuperQ](https://togithub.com/SuperQ) in [https://github.com/stretchr/testify/pull/1409](https://togithub.com/stretchr/testify/pull/1409) - Fix adding ? when no values passed by [@​lesichkovm](https://togithub.com/lesichkovm) in [https://github.com/stretchr/testify/pull/1320](https://togithub.com/stretchr/testify/pull/1320) - codegen: use standard header for generated files by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1406](https://togithub.com/stretchr/testify/pull/1406) - mock: AssertExpectations log reason only on failure by [@​hikyaru-suzuki](https://togithub.com/hikyaru-suzuki) in [https://github.com/stretchr/testify/pull/1360](https://togithub.com/stretchr/testify/pull/1360) - assert: fix flaky TestNeverTrue by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1417](https://togithub.com/stretchr/testify/pull/1417) - README: fix typos "set up" vs "setup" by [@​ossan-dev](https://togithub.com/ossan-dev) in [https://github.com/stretchr/testify/pull/1428](https://togithub.com/stretchr/testify/pull/1428) - mock: move regexp compilation outside of `Called` by [@​aud10slave](https://togithub.com/aud10slave) in [https://github.com/stretchr/testify/pull/631](https://togithub.com/stretchr/testify/pull/631) - assert: refactor internal func getLen() by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1445](https://togithub.com/stretchr/testify/pull/1445) - mock: deprecate type AnythingOfTypeArgument ([#​1434](https://togithub.com/stretchr/testify/issues/1434)) by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1441](https://togithub.com/stretchr/testify/pull/1441) - Remove no longer needed assert.canConvert by [@​alexandear](https://togithub.com/alexandear) in [https://github.com/stretchr/testify/pull/1470](https://togithub.com/stretchr/testify/pull/1470) - assert: ObjectsAreEqual: use time.Equal for time.Time types by [@​tscales](https://togithub.com/tscales) in [https://github.com/stretchr/testify/pull/1464](https://togithub.com/stretchr/testify/pull/1464) - Bump actions/checkout from 3 to 4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/stretchr/testify/pull/1466](https://togithub.com/stretchr/testify/pull/1466) - Bump actions/setup-go from 3.2.0 to 4.1.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/stretchr/testify/pull/1451](https://togithub.com/stretchr/testify/pull/1451) - fix: make EventuallyWithT concurrency safe by [@​czeslavo](https://togithub.com/czeslavo) in [https://github.com/stretchr/testify/pull/1395](https://togithub.com/stretchr/testify/pull/1395) - assert: fix httpCode and HTTPBody occur panic when http.Handler read Body by [@​hidu](https://togithub.com/hidu) in [https://github.com/stretchr/testify/pull/1484](https://togithub.com/stretchr/testify/pull/1484) - assert.EqualExportedValues: fix handling of arrays by [@​zrbecker](https://togithub.com/zrbecker) in [https://github.com/stretchr/testify/pull/1473](https://togithub.com/stretchr/testify/pull/1473) - .github: use latest Go versions by [@​kevinburkesegment](https://togithub.com/kevinburkesegment) in [https://github.com/stretchr/testify/pull/1489](https://togithub.com/stretchr/testify/pull/1489) - assert: Deprecate EqualExportedValues by [@​HaraldNordgren](https://togithub.com/HaraldNordgren) in [https://github.com/stretchr/testify/pull/1488](https://togithub.com/stretchr/testify/pull/1488) - suite: refactor test assertions by [@​alexandear](https://togithub.com/alexandear) in [https://github.com/stretchr/testify/pull/1474](https://togithub.com/stretchr/testify/pull/1474) - suite: fix SetupSubTest and TearDownSubTest execution order by [@​linusbarth](https://togithub.com/linusbarth) in [https://github.com/stretchr/testify/pull/1471](https://togithub.com/stretchr/testify/pull/1471) - docs: Fix deprecation comments for http package by [@​alexandear](https://togithub.com/alexandear) in [https://github.com/stretchr/testify/pull/1335](https://togithub.com/stretchr/testify/pull/1335) - Add map support doc comments to Subset and NotSubset by [@​jedevc](https://togithub.com/jedevc) in [https://github.com/stretchr/testify/pull/1306](https://togithub.com/stretchr/testify/pull/1306) - TestErrorIs/TestNotErrorIs: check error message contents by [@​craig65535](https://togithub.com/craig65535) in [https://github.com/stretchr/testify/pull/1435](https://togithub.com/stretchr/testify/pull/1435) - suite: fix subtest names (fix [#​1501](https://togithub.com/stretchr/testify/issues/1501)) by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1504](https://togithub.com/stretchr/testify/pull/1504) - assert: improve unsafe.Pointer tests by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1505](https://togithub.com/stretchr/testify/pull/1505) - assert: simplify isNil implementation by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1506](https://togithub.com/stretchr/testify/pull/1506) - assert.InEpsilonSlice: fix expected/actual order and other improvements by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1483](https://togithub.com/stretchr/testify/pull/1483) - Fix dependency cycle with objx [#​1292](https://togithub.com/stretchr/testify/issues/1292) by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1453](https://togithub.com/stretchr/testify/pull/1453) - mock: refactor TestIsArgsEqual by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1444](https://togithub.com/stretchr/testify/pull/1444) - mock: optimize argument matching checks by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1416](https://togithub.com/stretchr/testify/pull/1416) - assert: fix TestEventuallyTimeout by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1412](https://togithub.com/stretchr/testify/pull/1412) - CI: add go 1.21 in GitHub Actions by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1450](https://togithub.com/stretchr/testify/pull/1450) - suite: fix recoverAndFailOnPanic to report test failure at the right location by [@​dolmen](https://togithub.com/dolmen) in [https://github.com/stretchr/testify/pull/1502](https://togithub.com/stretchr/testify/pull/1502) - Update maintainers by [@​brackendawson](https://togithub.com/brackendawson) in [https://github.com/stretchr/testify/pull/1533](https://togithub.com/stretchr/testify/pull/1533) - assert: Fix EqualValues to handle overflow/underflow by [@​arjunmahishi](https://togithub.com/arjunmahishi) in [https://github.com/stretchr/testify/pull/1531](https://togithub.com/stretchr/testify/pull/1531) - assert: better formatting for Len() error by [@​kevinburkesegment](https://togithub.com/kevinburkesegment) in [https://github.com/stretchr/testify/pull/1485](https://togithub.com/stretchr/testify/pull/1485) - Ensure AssertExpectations does not fail in skipped tests by [@​ianrose14](https://togithub.com/ianrose14) in [https://github.com/stretchr/testify/pull/1331](https://togithub.com/stretchr/testify/pull/1331) - suite: fix deadlock in suite.Require()/Assert() by [@​arjunmahishi](https://togithub.com/arjunmahishi) in [https://github.com/stretchr/testify/pull/1535](https://togithub.com/stretchr/testify/pull/1535) - Revert "assert: ObjectsAreEqual: use time.Equal for time.Time type" by [@​brackendawson](https://togithub.com/brackendawson) in [https://github.com/stretchr/testify/pull/1537](https://togithub.com/stretchr/testify/pull/1537) - \[chore] Add issue templates by [@​arjunmahishi](https://togithub.com/arjunmahishi) in [https://github.com/stretchr/testify/pull/1538](https://togithub.com/stretchr/testify/pull/1538) - Update the build status badge by [@​brackendawson](https://togithub.com/brackendawson) in [https://github.com/stretchr/testify/pull/1540](https://togithub.com/stretchr/testify/pull/1540) - Update Github workflows setup-go to V5 by [@​hendrywiranto](https://togithub.com/hendrywiranto) in [https://github.com/stretchr/testify/pull/1545](https://togithub.com/stretchr/testify/pull/1545) - Support Pointer to Struct in EqualExportedValues by [@​Lucaber](https://togithub.com/Lucaber) in [https://github.com/stretchr/testify/pull/1517](https://togithub.com/stretchr/testify/pull/1517) - README: drop link to gorc by [@​guettli](https://togithub.com/guettli) in [https://github.com/stretchr/testify/pull/1248](https://togithub.com/stretchr/testify/pull/1248) - http_assertions: honour the msgAndArgs provided with each assertion by [@​arjunmahishi](https://togithub.com/arjunmahishi) in [https://github.com/stretchr/testify/pull/1548](https://togithub.com/stretchr/testify/pull/1548) - fix typos in comments and tests by [@​ccoVeille](https://togithub.com/ccoVeille) in [https://github.com/stretchr/testify/pull/1247](https://togithub.com/stretchr/testify/pull/1247) - Include the auto-release notes in releases by [@​brackendawson](https://togithub.com/brackendawson) in [https://github.com/stretchr/testify/pull/1550](https://togithub.com/stretchr/testify/pull/1550) - Add `NotImplements` and variants by [@​hslatman](https://togithub.com/hslatman) in [https://github.com/stretchr/testify/pull/1385](https://togithub.com/stretchr/testify/pull/1385) - Add support to compare uintptr by [@​bogdandrutu](https://togithub.com/bogdandrutu) in [https://github.com/stretchr/testify/pull/1339](https://togithub.com/stretchr/testify/pull/1339) - build(deps): bump github.com/stretchr/objx from 0.5.1 to 0.5.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/stretchr/testify/pull/1552](https://togithub.com/stretchr/testify/pull/1552) #### New Contributors - [@​SuperQ](https://togithub.com/SuperQ) made their first contribution in [https://github.com/stretchr/testify/pull/1394](https://togithub.com/stretchr/testify/pull/1394) - [@​programmer04](https://togithub.com/programmer04) made their first contribution in [https://github.com/stretchr/testify/pull/1392](https://togithub.com/stretchr/testify/pull/1392) - [@​echarrod](https://togithub.com/echarrod) made their first contribution in [https://github.com/stretchr/testify/pull/1389](https://togithub.com/stretchr/testify/pull/1389) - [@​davidjb](https://togithub.com/davidjb) made their first contribution in [https://github.com/stretchr/testify/pull/1349](https://togithub.com/stretchr/testify/pull/1349) - [@​LandonTClipp](https://togithub.com/LandonTClipp) made their first contribution in [https://github.com/stretchr/testify/pull/1346](https://togithub.com/stretchr/testify/pull/1346) - [@​alexandear](https://togithub.com/alexandear) made their first contribution in [https://github.com/stretchr/testify/pull/1410](https://togithub.com/stretchr/testify/pull/1410) - [@​lesichkovm](https://togithub.com/lesichkovm) made their first contribution in [https://github.com/stretchr/testify/pull/1320](https://togithub.com/stretchr/testify/pull/1320) - [@​dolmen](https://togithub.com/dolmen) made their first contribution in [https://github.com/stretchr/testify/pull/1406](https://togithub.com/stretchr/testify/pull/1406) - [@​hikyaru-suzuki](https://togithub.com/hikyaru-suzuki) made their first contribution in [https://github.com/stretchr/testify/pull/1360](https://togithub.com/stretchr/testify/pull/1360) - [@​ossan-dev](https://togithub.com/ossan-dev) made their first contribution in [https://github.com/stretchr/testify/pull/1428](https://togithub.com/stretchr/testify/pull/1428) - [@​aud10slave](https://togithub.com/aud10slave) made their first contribution in [https://github.com/stretchr/testify/pull/631](https://togithub.com/stretchr/testify/pull/631) - [@​tscales](https://togithub.com/tscales) made their first contribution in [https://github.com/stretchr/testify/pull/1464](https://togithub.com/stretchr/testify/pull/1464) - [@​czeslavo](https://togithub.com/czeslavo) made their first contribution in [https://github.com/stretchr/testify/pull/1395](https://togithub.com/stretchr/testify/pull/1395) - [@​hidu](https://togithub.com/hidu) made their first contribution in [https://github.com/stretchr/testify/pull/1484](https://togithub.com/stretchr/testify/pull/1484) - [@​zrbecker](https://togithub.com/zrbecker) made their first contribution in [https://github.com/stretchr/testify/pull/1473](https://togithub.com/stretchr/testify/pull/1473) - [@​kevinburkesegment](https://togithub.com/kevinburkesegment) made their first contribution in [https://github.com/stretchr/testify/pull/1489](https://togithub.com/stretchr/testify/pull/1489) - [@​linusbarth](https://togithub.com/linusbarth) made their first contribution in [https://github.com/stretchr/testify/pull/1471](https://togithub.com/stretchr/testify/pull/1471) - [@​jedevc](https://togithub.com/jedevc) made their first contribution in [https://github.com/stretchr/testify/pull/1306](https://togithub.com/stretchr/testify/pull/1306) - [@​craig65535](https://togithub.com/craig65535) made their first contribution in [https://github.com/stretchr/testify/pull/1435](https://togithub.com/stretchr/testify/pull/1435) - [@​arjunmahishi](https://togithub.com/arjunmahishi) made their first contribution in [https://github.com/stretchr/testify/pull/1531](https://togithub.com/stretchr/testify/pull/1531) - [@​ianrose14](https://togithub.com/ianrose14) made their first contribution in [https://github.com/stretchr/testify/pull/1331](https://togithub.com/stretchr/testify/pull/1331) - [@​hendrywiranto](https://togithub.com/hendrywiranto) made their first contribution in [https://github.com/stretchr/testify/pull/1545](https://togithub.com/stretchr/testify/pull/1545) - [@​Lucaber](https://togithub.com/Lucaber) made their first contribution in [https://github.com/stretchr/testify/pull/1517](https://togithub.com/stretchr/testify/pull/1517) - [@​guettli](https://togithub.com/guettli) made their first contribution in [https://github.com/stretchr/testify/pull/1248](https://togithub.com/stretchr/testify/pull/1248) - [@​ccoVeille](https://togithub.com/ccoVeille) made their first contribution in [https://github.com/stretchr/testify/pull/1247](https://togithub.com/stretchr/testify/pull/1247) - [@​hslatman](https://togithub.com/hslatman) made their first contribution in [https://github.com/stretchr/testify/pull/1385](https://togithub.com/stretchr/testify/pull/1385) - [@​bogdandrutu](https://togithub.com/bogdandrutu) made their first contribution in [https://github.com/stretchr/testify/pull/1339](https://togithub.com/stretchr/testify/pull/1339) **Full Changelog**: stretchr/testify@v1.8.4...v1.9.0 </details> <details> <summary>golang/go (go)</summary> ### [`v1.22.4`](https://togithub.com/golang/go/compare/go1.22.3...go1.22.4) ### [`v1.22.3`](https://togithub.com/golang/go/compare/go1.22.2...go1.22.3) ### [`v1.22.2`](https://togithub.com/golang/go/compare/go1.22.1...go1.22.2) ### [`v1.22.1`](https://togithub.com/golang/go/compare/go1.22.0...go1.22.1) </details> <details> <summary>golangci/golangci-lint (golangci-lint)</summary> ### [`v1.59.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1590) 1. Enhancements - Add SARIF output format - Allow the analysis of generated files (`issues.exclude-generated: disable`) 2. Updated linters - `errcheck`: fix deprecation warning - `go-critic`: from 0.11.3 to 0.11.4 - `gosec`: from 2.20.0 to [`5f0084e`](https://togithub.com/golangci/golangci-lint/commit/5f0084eb01a9) (fix G601 and G113 performance issues) - `sloglint`: from 0.6.0 to 0.7.0 (new option `forbidden-keys`) - `testifylint`: from 1.2.0 to 1.3.0 (new checker `negative-positive` and new option `go-require.ignore-http-handlers`) 3. Misc. - ️️⚠️ Deprecate `github-action` output format - ️️⚠️ Deprecate `issues.exclude-generated-strict` option (replaced by `issues.exclude-generated: strict`) - ️️⚠️ Add warning about disabled and deprecated linters (level 2) ### [`v1.58.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1582) 1. Updated linters - `canonicalheader`: from 1.0.6 to 1.1.1 - `gosec`: from 2.19.0 to 2.20.0 - `musttag`: from 0.12.1 to 0.12.2 - `nilnil`: from 0.1.8 to 0.1.9 2. Documentation - Improve integrations and install pages ### [`v1.58.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1581) 1. Updated linters - `tagalign`: from 1.3.3 to 1.3.4 - `protogetter`: from 0.3.5 to 0.3.6 - `gochecknoinits`: fix analyzer name 2. Fixes - Restores previous `gihub-actions` output format (removes GitHub Action problem matchers) ### [`v1.58.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1580) 1. New linters - `fatcontext`: https://github.com/Crocmagnon/fatcontext - `canonicalheader`: https://github.com/lasiar/canonicalheader 2. Updated linters - `copyloopvar`: from 1.0.10 to 1.1.0 (`ignore-alias` is replaced by `check-alias` with the opposite behavior) - `decorder`: from 0.4.1 to 0.4.2 - `errname`: from 0.1.12 to 0.1.13 - `errorlint`: from 1.4.8 to 1.5.1 (new options `allowed-errors` and `allowed-errors-wildcard`) - `execinquery`: deprecate linter⚠️ - `gci`: from 0.12.3 to 0.13.4 (new section `localModule`) - `gocritic`: from 0.11.2 to 0.11.3 - `spancheck`: from 0.5.3 to 0.6.1 - `goerr113` is replaced by `err113`⚠️ - `gomnd` is replaced by `mnd`⚠️ - `gomodguard`: from 1.3.1 to 1.3.2 - `grouper`: from 1.1.1 to 1.1.2 - `intrange`: from 0.1.1 to 0.1.2 - `mirror`: from 1.1.0 to 1.2.0 - `misspell`: from 0.4.1 to 0.5.1 - `musttag`: from 0.9.0 to 0.12.1 - `nilnil`: from 0.1.7 to 0.1.8 - `nonamedreturns`: from 1.0.4 to 1.0.5 - `promlinter`: from 0.2.0 to 0.3.0 - `sloglint`: from 0.5.0 to 0.6.0 - `unparam`: bump to HEAD ([`063aff9`](https://togithub.com/golangci/golangci-lint/commit/063aff900ca150b80930c8de76f11d7e6488222f)) - `whitespace`: from 0.1.0 to 0.1.1 3. Enhancements - Speed up "fast" linters when only "fast" linters are run: between 40% and 80% faster at first run (i.e. without cache) 4. Fixes - Use version with module plugins - Skip `go.mod` report inside autogenerated processor - Keep only `typecheck` issues when needed - Don't hide `typecheck` errors inside diff processor 5. Misc. -⚠️ log an error when using previously deprecated linters ([Linter Deprecation Cycle](https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle)) - [`deadcode`](https://togithub.com/remyoudompheng/go-misc/tree/master/deadcode): deprecated since v1.49.0 (2022-08-23). - [`exhaustivestruct`](https://togithub.com/mbilski/exhaustivestruct): deprecated since v1.46.0 (2022-05-08). - [`golint`](https://togithub.com/golang/lint): deprecated since v1.41.0 (2021-06-15). - [`ifshort`](https://togithub.com/esimonov/ifshort): deprecated since v1.48.0 (2022-08-04). - [`interfacer`](https://togithub.com/mvdan/interfacer): deprecated since v1.38.0 (2021-03-03). - [`maligned`](https://togithub.com/mdempsky/maligned): deprecated since v1.38.0 (2021-03-03). - [`nosnakecase`](https://togithub.com/sivchari/nosnakecase): deprecated since v1.48.0 (2022-08-04). - [`scopelint`](https://togithub.com/kyoh86/scopelint): deprecated since v1.39.0 (2021-03-25). - [`structcheck`](https://togithub.com/opennota/check): deprecated since v1.49.0 (2022-08-23). - [`varcheck`](https://togithub.com/opennota/check): deprecated since v1.49.0 (2022-08-23). -⚠️ Deprecate usage of linter alternative names - Remove help display on errors with `config verify` command - Add `pre-commit` hook to run `config verify` - Improve `github-action` output 6. Documentation - Remove deprecated Atom from Editor Integrations GitHub Action (v5.1.0) for golangci-lint: - supports for `pull`, `pull_request_target`, and `merge_group` events with the option `only-new-issues`. - ️️⚠️ `skip-pkg-cache` and `skip-build-cache` have been removed because the cache related to Go itself is already handled by `actions/setup-go`. - with golangci-lint v1.58, the file information (path and position) will be displayed on the log. ### [`v1.57.2`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) 1. Updated linters - `contextcheck`: from 1.1.4 to 1.1.5 - `copyloopvar`: from 1.0.8 to 1.0.10 - `ginkgolinter`: from 0.16.1 to 0.16.2 - `goconst`: from 1.7.0 to 1.7.1 - `gomoddirectives`: from 0.2.3 to 0.2.4 - `intrange`: from 0.1.0 to 0.1.1 2. Misc. - Display warnings on deprecated linter options - Fix missing `colored-tab` output format - Fix TeamCity `inspectionType` service message 3. Documentation - Remove invalid example about mixing files and directory - Improve linters page ### [`v1.57.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) 1. Fixes - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) 1. New linters - `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar - `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters - `dupword`: from 0.0.13 to 0.0.14 - `gci`: from 0.12.1 to 0.12.3 - `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) - `go-critic`: from 0.11.1 to 0.11.2 - `go-critic`: support of `enable-all` and `disable-all` options - `go-spancheck`: from 0.5.2 to 0.5.3 - `gomodguard`: from 1.3.0 to 1.3.1 - `govet`: deprecation of `check-shadowing`⚠️ - `govet`: disable temporarily `httpresponse` because of a bug [https://github.com/golang/go/issues/66259](https://togithub.com/golang/go/issues/66259) - `misspell`: add `extra-words` - `musttag`: from 0.8.0 to 0.9.0 - `nakedret`: from 2.0.2 to 2.0.4 - `paralleltest`: from 1.0.9 to 1.0.10 - `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) - `protogetter`: from 0.3.4 to 0.3.5 - `revive`: add `exclude` option - `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) - `staticcheck`: from 0.4.6 to 0.4.7 - `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) - `unconvert`: to HEAD (new options `fast-math` and `safe`) - `wrapcheck`: from 2.8.1 to 2.8.3 - Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements - 🧩New custom linters system https://golangci-lint.run/plugins/module-plugins/ - Allow running only a specific linter without modifying the file configuration (`--enable-only`) - Allow custom sort order for the reports (`output.sort-order`) - Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` - Add `config verify` command to check the configuration against the JSON Schema - Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) - Syntax to not override `severity` from linters (`@linter`) - Use severities from `gosec` - Create automatically directory related to `output.formats.path` - Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. -⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) -⚠️ Deprecated CLI flags have been removed (deprecated since 2018) -⚠️ Move `show-stats` option from `run` to `output` configuration section -⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options -⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax - Internal rewrite of the CLI - Improve 'no go files to analyze' message - Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation -⚠️ Define the linter deprecation cycle https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle - 🎉Use information from the previous release to create linter pages - Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json - Reorganize documentation pages - Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important⚠️ ** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/alecthomas/localcache). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjAuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM4OC4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Go version
go version go1.22.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Using
httpresponse
pass through golangci-lint (currentmaster
branch) on this project golangci-repro-4482Related to golangci/golangci-lint#4482
I bisected
x/tools
and the first commit with this problem is c111c4dfathe value of
n
inn, ok := aliases.Unalias(t).(*types.Named)
(insideIsNamedType
) is nil andok
is true.I think the problem is related to
named, _ = aliases.Unalias(t).(*types.Named)
insideReceiverNamed
.The type assertion is "forcing" the type of
named
.I'm still trying to find a minimal reproducible example, but if I extract the code the panic disappears.
What did you see happen?
A panic:
What did you expect to see?
No panic.
The text was updated successfully, but these errors were encountered: