-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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". |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci-lint](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) 1. Fixes: - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://github.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 [golang/go#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://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://github.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 [golang/go#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://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://github.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 [golang/go#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://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://github.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 [golang/go#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://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://github.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 [golang/go#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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1562) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1561) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1560) [Compare Source](https://github.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://github.com/golangci/golangci-lint/commit/20221223090309)-7455f1af531d to [`2024010`](https://github.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://github.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://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci-lint](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1580) [Compare Source](https://github.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://github.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://github.com/remyoudompheng/go-misc/tree/master/deadcode): deprecated since v1.49.0 (2022-08-23). - [`exhaustivestruct`](https://github.com/mbilski/exhaustivestruct): deprecated since v1.46.0 (2022-05-08). - [`golint`](https://github.com/golang/lint): deprecated since v1.41.0 (2021-06-15). - [`ifshort`](https://github.com/esimonov/ifshort): deprecated since v1.48.0 (2022-08-04). - [`interfacer`](https://github.com/mvdan/interfacer): deprecated since v1.38.0 (2021-03-03). - [`maligned`](https://github.com/mdempsky/maligned): deprecated since v1.38.0 (2021-03-03). - [`nosnakecase`](https://github.com/sivchari/nosnakecase): deprecated since v1.48.0 (2022-08-04). - [`scopelint`](https://github.com/kyoh86/scopelint): deprecated since v1.39.0 (2021-03-25). - [`structcheck`](https://github.com/opennota/check): deprecated since v1.49.0 (2022-08-23). - [`varcheck`](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1572) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1570) [Compare Source](https://github.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 [golang/go#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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1562) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1561) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1560) [Compare Source](https://github.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://github.com/golangci/golangci-lint/commit/20221223090309)-7455f1af531d to [`2024010`](https://github.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://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1552) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1551) [Compare Source](https://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1550) [Compare Source](https://github.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://github.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>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | Type | Update | |---|---|---|---|---|---|---|---| | [github.com/stretchr/testify](https://github.com/stretchr/testify) | `v1.8.4` -> `v1.9.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fstretchr%2ftestify/v1.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fstretchr%2ftestify/v1.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fstretchr%2ftestify/v1.8.4/v1.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fstretchr%2ftestify/v1.8.4/v1.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | require | minor | | [go](https://github.com/golang/go) | `1.22.0` -> `1.22.4` | [![age](https://developer.mend.io/api/mc/badges/age/hermit/go/1.22.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/hermit/go/1.22.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/hermit/go/1.22.0/1.22.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/hermit/go/1.22.0/1.22.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | patch | | [golangci-lint](https://github.com/golangci/golangci-lint) | `1.56.2` -> `1.59.0` | [![age](https://developer.mend.io/api/mc/badges/age/hermit/golangci-lint/1.59.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/hermit/golangci-lint/1.59.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/hermit/golangci-lint/1.56.2/1.59.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/hermit/golangci-lint/1.56.2/1.59.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | minor | --- ### Release Notes <details> <summary>stretchr/testify (github.com/stretchr/testify)</summary> ### [`v1.9.0`](https://github.com/stretchr/testify/releases/tag/v1.9.0) [Compare Source](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0) #### What's Changed - Fix Go modules version by [@​SuperQ](https://github.com/SuperQ) in [stretchr/testify#1394 - Document that require is not safe to call in created goroutines by [@​programmer04](https://github.com/programmer04) in [stretchr/testify#1392 - Remove myself from MAINTAINERS.md by [@​mvdkleijn](https://github.com/mvdkleijn) in [stretchr/testify#1367 - Correct spelling/grammar by [@​echarrod](https://github.com/echarrod) in [stretchr/testify#1389 - docs: Update URLs in README by [@​davidjb](https://github.com/davidjb) in [stretchr/testify#1349 - Update mockery link to Github Pages in README by [@​LandonTClipp](https://github.com/LandonTClipp) in [stretchr/testify#1346 - docs: Fix typos in tests and comments by [@​alexandear](https://github.com/alexandear) in [stretchr/testify#1410 - CI: tests from go1.17 by [@​SuperQ](https://github.com/SuperQ) in [stretchr/testify#1409 - Fix adding ? when no values passed by [@​lesichkovm](https://github.com/lesichkovm) in [stretchr/testify#1320 - codegen: use standard header for generated files by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1406 - mock: AssertExpectations log reason only on failure by [@​hikyaru-suzuki](https://github.com/hikyaru-suzuki) in [stretchr/testify#1360 - assert: fix flaky TestNeverTrue by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1417 - README: fix typos "set up" vs "setup" by [@​ossan-dev](https://github.com/ossan-dev) in [stretchr/testify#1428 - mock: move regexp compilation outside of `Called` by [@​aud10slave](https://github.com/aud10slave) in [stretchr/testify#631 - assert: refactor internal func getLen() by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1445 - mock: deprecate type AnythingOfTypeArgument ([#​1434](https://github.com/stretchr/testify/issues/1434)) by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1441 - Remove no longer needed assert.canConvert by [@​alexandear](https://github.com/alexandear) in [stretchr/testify#1470 - assert: ObjectsAreEqual: use time.Equal for time.Time types by [@​tscales](https://github.com/tscales) in [stretchr/testify#1464 - Bump actions/checkout from 3 to 4 by [@​dependabot](https://github.com/dependabot) in [stretchr/testify#1466 - Bump actions/setup-go from 3.2.0 to 4.1.0 by [@​dependabot](https://github.com/dependabot) in [stretchr/testify#1451 - fix: make EventuallyWithT concurrency safe by [@​czeslavo](https://github.com/czeslavo) in [stretchr/testify#1395 - assert: fix httpCode and HTTPBody occur panic when http.Handler read Body by [@​hidu](https://github.com/hidu) in [stretchr/testify#1484 - assert.EqualExportedValues: fix handling of arrays by [@​zrbecker](https://github.com/zrbecker) in [stretchr/testify#1473 - .github: use latest Go versions by [@​kevinburkesegment](https://github.com/kevinburkesegment) in [stretchr/testify#1489 - assert: Deprecate EqualExportedValues by [@​HaraldNordgren](https://github.com/HaraldNordgren) in [stretchr/testify#1488 - suite: refactor test assertions by [@​alexandear](https://github.com/alexandear) in [stretchr/testify#1474 - suite: fix SetupSubTest and TearDownSubTest execution order by [@​linusbarth](https://github.com/linusbarth) in [stretchr/testify#1471 - docs: Fix deprecation comments for http package by [@​alexandear](https://github.com/alexandear) in [stretchr/testify#1335 - Add map support doc comments to Subset and NotSubset by [@​jedevc](https://github.com/jedevc) in [stretchr/testify#1306 - TestErrorIs/TestNotErrorIs: check error message contents by [@​craig65535](https://github.com/craig65535) in [stretchr/testify#1435 - suite: fix subtest names (fix [#​1501](https://github.com/stretchr/testify/issues/1501)) by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1504 - assert: improve unsafe.Pointer tests by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1505 - assert: simplify isNil implementation by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1506 - assert.InEpsilonSlice: fix expected/actual order and other improvements by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1483 - Fix dependency cycle with objx [#​1292](https://github.com/stretchr/testify/issues/1292) by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1453 - mock: refactor TestIsArgsEqual by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1444 - mock: optimize argument matching checks by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1416 - assert: fix TestEventuallyTimeout by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1412 - CI: add go 1.21 in GitHub Actions by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1450 - suite: fix recoverAndFailOnPanic to report test failure at the right location by [@​dolmen](https://github.com/dolmen) in [stretchr/testify#1502 - Update maintainers by [@​brackendawson](https://github.com/brackendawson) in [stretchr/testify#1533 - assert: Fix EqualValues to handle overflow/underflow by [@​arjunmahishi](https://github.com/arjunmahishi) in [stretchr/testify#1531 - assert: better formatting for Len() error by [@​kevinburkesegment](https://github.com/kevinburkesegment) in [stretchr/testify#1485 - Ensure AssertExpectations does not fail in skipped tests by [@​ianrose14](https://github.com/ianrose14) in [stretchr/testify#1331 - suite: fix deadlock in suite.Require()/Assert() by [@​arjunmahishi](https://github.com/arjunmahishi) in [stretchr/testify#1535 - Revert "assert: ObjectsAreEqual: use time.Equal for time.Time type" by [@​brackendawson](https://github.com/brackendawson) in [stretchr/testify#1537 - \[chore] Add issue templates by [@​arjunmahishi](https://github.com/arjunmahishi) in [stretchr/testify#1538 - Update the build status badge by [@​brackendawson](https://github.com/brackendawson) in [stretchr/testify#1540 - Update Github workflows setup-go to V5 by [@​hendrywiranto](https://github.com/hendrywiranto) in [stretchr/testify#1545 - Support Pointer to Struct in EqualExportedValues by [@​Lucaber](https://github.com/Lucaber) in [stretchr/testify#1517 - README: drop link to gorc by [@​guettli](https://github.com/guettli) in [stretchr/testify#1248 - http_assertions: honour the msgAndArgs provided with each assertion by [@​arjunmahishi](https://github.com/arjunmahishi) in [stretchr/testify#1548 - fix typos in comments and tests by [@​ccoVeille](https://github.com/ccoVeille) in [stretchr/testify#1247 - Include the auto-release notes in releases by [@​brackendawson](https://github.com/brackendawson) in [stretchr/testify#1550 - Add `NotImplements` and variants by [@​hslatman](https://github.com/hslatman) in [stretchr/testify#1385 - Add support to compare uintptr by [@​bogdandrutu](https://github.com/bogdandrutu) in [stretchr/testify#1339 - build(deps): bump github.com/stretchr/objx from 0.5.1 to 0.5.2 by [@​dependabot](https://github.com/dependabot) in [stretchr/testify#1552 #### New Contributors - [@​SuperQ](https://github.com/SuperQ) made their first contribution in [stretchr/testify#1394 - [@​programmer04](https://github.com/programmer04) made their first contribution in [stretchr/testify#1392 - [@​echarrod](https://github.com/echarrod) made their first contribution in [stretchr/testify#1389 - [@​davidjb](https://github.com/davidjb) made their first contribution in [stretchr/testify#1349 - [@​LandonTClipp](https://github.com/LandonTClipp) made their first contribution in [stretchr/testify#1346 - [@​alexandear](https://github.com/alexandear) made their first contribution in [stretchr/testify#1410 - [@​lesichkovm](https://github.com/lesichkovm) made their first contribution in [stretchr/testify#1320 - [@​dolmen](https://github.com/dolmen) made their first contribution in [stretchr/testify#1406 - [@​hikyaru-suzuki](https://github.com/hikyaru-suzuki) made their first contribution in [stretchr/testify#1360 - [@​ossan-dev](https://github.com/ossan-dev) made their first contribution in [stretchr/testify#1428 - [@​aud10slave](https://github.com/aud10slave) made their first contribution in [stretchr/testify#631 - [@​tscales](https://github.com/tscales) made their first contribution in [stretchr/testify#1464 - [@​czeslavo](https://github.com/czeslavo) made their first contribution in [stretchr/testify#1395 - [@​hidu](https://github.com/hidu) made their first contribution in [stretchr/testify#1484 - [@​zrbecker](https://github.com/zrbecker) made their first contribution in [stretchr/testify#1473 - [@​kevinburkesegment](https://github.com/kevinburkesegment) made their first contribution in [stretchr/testify#1489 - [@​linusbarth](https://github.com/linusbarth) made their first contribution in [stretchr/testify#1471 - [@​jedevc](https://github.com/jedevc) made their first contribution in [stretchr/testify#1306 - [@​craig65535](https://github.com/craig65535) made their first contribution in [stretchr/testify#1435 - [@​arjunmahishi](https://github.com/arjunmahishi) made their first contribution in [stretchr/testify#1531 - [@​ianrose14](https://github.com/ianrose14) made their first contribution in [stretchr/testify#1331 - [@​hendrywiranto](https://github.com/hendrywiranto) made their first contribution in [stretchr/testify#1545 - [@​Lucaber](https://github.com/Lucaber) made their first contribution in [stretchr/testify#1517 - [@​guettli](https://github.com/guettli) made their first contribution in [stretchr/testify#1248 - [@​ccoVeille](https://github.com/ccoVeille) made their first contribution in [stretchr/testify#1247 - [@​hslatman](https://github.com/hslatman) made their first contribution in [stretchr/testify#1385 - [@​bogdandrutu](https://github.com/bogdandrutu) made their first contribution in [stretchr/testify#1339 **Full Changelog**: stretchr/testify@v1.8.4...v1.9.0 </details> <details> <summary>golang/go (go)</summary> ### [`v1.22.4`](https://github.com/golang/go/compare/go1.22.3...go1.22.4) ### [`v1.22.3`](https://github.com/golang/go/compare/go1.22.2...go1.22.3) ### [`v1.22.2`](https://github.com/golang/go/compare/go1.22.1...go1.22.2) ### [`v1.22.1`](https://github.com/golang/go/compare/go1.22.0...go1.22.1) </details> <details> <summary>golangci/golangci-lint (golangci-lint)</summary> ### [`v1.59.0`](https://github.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://github.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://github.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://github.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://github.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://github.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://github.com/remyoudompheng/go-misc/tree/master/deadcode): deprecated since v1.49.0 (2022-08-23). - [`exhaustivestruct`](https://github.com/mbilski/exhaustivestruct): deprecated since v1.46.0 (2022-05-08). - [`golint`](https://github.com/golang/lint): deprecated since v1.41.0 (2021-06-15). - [`ifshort`](https://github.com/esimonov/ifshort): deprecated since v1.48.0 (2022-08-04). - [`interfacer`](https://github.com/mvdan/interfacer): deprecated since v1.38.0 (2021-03-03). - [`maligned`](https://github.com/mdempsky/maligned): deprecated since v1.38.0 (2021-03-03). - [`nosnakecase`](https://github.com/sivchari/nosnakecase): deprecated since v1.48.0 (2022-08-04). - [`scopelint`](https://github.com/kyoh86/scopelint): deprecated since v1.39.0 (2021-03-25). - [`structcheck`](https://github.com/opennota/check): deprecated since v1.49.0 (2022-08-23). - [`varcheck`](https://github.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://github.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://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1571) 1. Fixes - Ignore issues with invalid position (e.g. `contextcheck`). ### [`v1.57.0`](https://github.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 [golang/go#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://github.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: