chore(deps): update dependency dominikh/go-tools to v2024 #209
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2023.1.7
->2024.1.1
Release Notes
dominikh/go-tools (dominikh/go-tools)
v2024.1.1
: Staticcheck 2024.1.1 (v0.5.1)Compare Source
This release fixes the detection of the used Go version when Go was compiled with experimental features such as
rangefunc
orboringcrypto
(#1586).v2024.1
: Staticcheck 2024.1 (v0.5.0)Compare Source
Backwards incompatible changes
Staticcheck 2024.1 contains the following backwards incompatible changes:
keyify
utility has been removed. The recommended alternative is gopls.staticcheck -merge
now exits with a non-zero status if any problems have been found.Improved Go 1.22 support
This release updates Staticcheck’s database of deprecated standard library APIs to cover the Go 1.22 release. Furthermore, checks have been updated to correctly handle the new “for” loop variable scoping behavior as well as ranging over integers.
Added Go 1.23 support
Staticcheck 2024.1 has full support for iterators / range-over-func. Furthermore, SA1015 will skip any code targeting Go 1.23 or newer, as it is now possible to use
time.Tick
without leaking memory.Improved handling of Go versions
Go 1.21 more rigorously defined the meaning of the
go
directive ingo.mod
files, as well as its interactions with//go:build go1.N
build constraints. The go directive now specifies a minimum Go version for the module. Furthermore, it sets the language version that is in effect, which may change the semantics of Go code. For example, before Go 1.22, loop variables were reused across iterations, but since Go 1.22, loop variables only exist for the duration of an iteration. Modules that specifygo 1.22
will use the new semantics, while modules that specify an older version will not.Individual files can both upgrade and downgrade their language version by using
//go:build go1.N
directives. In a module that requires Go 1.22, a file specifying Go 1.21 will experience the old loop variable semantics, and vice versa. Because the Go module as a whole still specifies a minimum version, even files specifying an older version will have access to the standard library of the minimum version.Staticcheck 2024.1 takes all of this into consideration when analyzing the behavior of Go code, when determining which checks are applicable, and when making suggestions. Older versions of Staticcheck were already aware of Go versions, but 2024.1 works on a more fine-grained, per-file basis, and differentiates between the pre- and post-1.21 semantics of the go directive.
The
-go
command line flag continues to exist. It will override any module-based version selection. This is primarily useful for Go modules that target older Go versions (because here, the go directive didn’t specify a minimum version), or when working outside of Go modules.To prevent misinterpreting code, Staticcheck now refuses to analyze modules that require a version of Go that is newer than that with which Staticcheck was built.
Checks
New checks
The following checks have been added:
errors.Is
where the two arguments have been swapped.io.WriteString(w, string(b))
as it would be both simpler and more efficient to usew.Write(b)
.Changed checks
The following checks have been improved:
len(x) > 0
aslen(x) == 0
(issue 1422).if else
branches (issue 1447).struct{}
) as context keys (issue 1504).math
package (issue 1470).Miscellaneous changes and fixes
keyify
utility has been deleted. This functionality is provided by gopls nowadays.staticcheck -merge
now exits with a non-zero exit status if any problems were found. This matches the behavior of non-merge uses.staticcheck.conf
files now cause more useful errors to be emitted.v2024.1rc1
: Staticcheck 2024.1rc1 (v0.5.0-rc.1)Compare Source
This is a release candidate of Staticcheck 2024.1. It has been built with Go 1.23rc1 and supports analyzing Go 1.23 code, including range-over-func iterators.
Backwards incompatible changes
Staticcheck 2024.1 contains the following backwards incompatible changes:
keyify
utility has been removed. The recommended alternative is gopls.staticcheck -merge
now exits with a non-zero status if any problems have been found.Improved Go 1.22 support
This release updates Staticcheck’s database of deprecated standard library APIs to cover the Go 1.22 release. Furthermore, checks have been updated to correctly handle the new “for” loop variable scoping behavior as well as ranging over integers.
Added Go 1.23 support
Staticcheck 2024.1 has full support for iterators / range-over-func. Furthermore, SA1015 will skip any code targeting Go 1.23 or newer, as it is now possible to use
time.Tick
without leaking memory.Improved handling of Go versions
Go 1.21 more rigorously defined the meaning of the
go
directive ingo.mod
files, as well as its interactions with//go:build go1.N
build constraints. The go directive now specifies a minimum Go version for the module. Furthermore, it sets the language version that is in effect, which may change the semantics of Go code. For example, before Go 1.22, loop variables were reused across iterations, but since Go 1.22, loop variables only exist for the duration of an iteration. Modules that specifygo 1.22
will use the new semantics, while modules that specify an older version will not.Individual files can both upgrade and downgrade their language version by using
//go:build go1.N
directives. In a module that requires Go 1.22, a file specifying Go 1.21 will experience the old loop variable semantics, and vice versa. Because the Go module as a whole still specifies a minimum version, even files specifying an older version will have access to the standard library of the minimum version.Staticcheck 2024.1 takes all of this into consideration when analyzing the behavior of Go code, when determining which checks are applicable, and when making suggestions. Older versions of Staticcheck were already aware of Go versions, but 2024.1 works on a more fine-grained, per-file basis, and differentiates between the pre- and post-1.21 semantics of the go directive.
The
-go
command line flag continues to exist. It will override any module-based version selection. This is primarily useful for Go modules that target older Go versions (because here, the go directive didn’t specify a minimum version), or when working outside of Go modules.To prevent misinterpreting code, Staticcheck now refuses to analyze modules that require a version of Go that is newer than that with which Staticcheck was built.
Checks
New checks
The following checks have been added:
errors.Is
where the two arguments have been swapped.io.WriteString(w, string(b))
as it would be both simpler and more efficient to usew.Write(b)
.Changed checks
The following checks have been improved:
len(x) > 0
aslen(x) == 0
(issue 1422).if else
branches (issue 1447).struct{}
) as context keys (issue 1504).math
package (issue 1470).Miscellaneous changes and fixes
keyify
utility has been deleted. This functionality is provided by gopls nowadays.staticcheck -merge
now exits with a non-zero exit status if any problems were found. This matches the behavior of non-merge uses.staticcheck.conf
files now cause more useful errors to be emitted.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.
This PR was generated by Mend Renovate. View the repository job log.