Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Oct 14, 2025

This PR contains the following updates:

Package Update Change OpenSSF
dominikh/go-tools major v0.6.0 -> 2025.1.1 OpenSSF Scorecard

Release Notes

dominikh/go-tools (dominikh/go-tools)

v2025.1.1: Staticcheck 2025.1.1 (v0.6.1)

Compare Source

This is a re-release of 2025.1 but with prebuilt binaries that have been built with Go 1.24.1.

v2025.1: Staticcheck 2025.1 (v0.6.0)

Compare Source

Added Go 1.24 support

This release adds support for Go 1.24.

Checks

Changed checks

The following checks have been improved:

  • U1000 treats all fields in a struct as used if the struct has a field of type structs.HostLayout.
  • S1009 now emits a clearer message.
  • S1008 no longer recommends simplifying branches that contain comments (issue 704, issue 1488).
  • S1009 now flags another redundant nil check (issue 1605).
  • QF1002 now emits a valid automatic fix for switches that use initialization statements (issue 1613).

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 or boringcrypto (#​1586).

v2024.1: Staticcheck 2024.1 (v0.5.0)

Compare Source

Backwards incompatible changes

Staticcheck 2024.1 contains the following backwards incompatible changes:

  • The 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 in go.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 specify go 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:

  • SA1031 flags overlapping destination and source slices passed to certain encoding functions.
  • SA1032 flags calls to errors.Is where the two arguments have been swapped.
  • SA4032 flags impossible comparisons of runtime.GOOS and runtime.GOARCH based on the file’s build tags.
  • SA6006 flags io.WriteString(w, string(b)) as it would be both simpler and more efficient to use w.Write(b).
  • SA9009 flags comments that look like they intend to be compiler directives but which aren’t due to extraneous whitespace.

Changed checks

The following checks have been improved:

  • QF1001 no longer panics on expressions involving “key: value” pairs (issue 1484).
  • S1008 now understands that some built-in functions never return negative values. For example, it now negates len(x) > 0 as len(x) == 0 (issue 1422).
  • S1009 now flags unnecessary nil checks that involve selector expressions (issue 1527).
  • S1017 no longer flags if else branches (issue 1447).
  • SA1006 now detects more Printf-like functions from the standard library (issue 1528).
  • SA1015 now skips any code targeting Go 1.23 or newer (issue 1558).
  • SA1029 now flags uses of the empty struct (struct{}) as context keys (issue 1504).
  • SA4003 now flags pointless integer comparisons that involve literals, not just constants from the math package (issue 1470).
  • SA4015 now supports conversions that involve generics.
  • SA4023 no longer panics on type sets that contain arrays (issue 1397).
  • SA5001 now emits a clearer message (issue 1489).
  • SA9003 has been disabled by default because of too many noisy positives (issue 321).
  • ST1000 now permits punctuation following the package name, as in “Package pkg, which …” (issue 1452).
  • ST1018 now accepts variation selectors in emoji and certain Arabic formatting characters in string literals (issue 1456).
  • ST1020 no longer flags comments that start with a deprecation notice (issue 1378).
  • U1000 handles generic interfaces slightly better, reducing the number of false positives.
  • Due to improvements in the intermediate representation, various checks may now detect more problems.

Miscellaneous changes and fixes

  • The 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.
  • Malformed staticcheck.conf files now cause more useful errors to be emitted.
  • Labeled statements with blank labels no longer cause panics.
  • Functions with named return parameters that never actually return no longer cause panics (issue 1533).

v2023.1.7: Staticcheck 2023.1.7 (v0.4.7)

Compare Source

This release fixes some minor issues in Staticcheck’s intermediate representation. Furthermore, it improves the way QF1003 generates suggested fixes, working around constraints in the language server protocol.

The released binaries for this version have been built with Go 1.22 and should no longer panic when checking code targeting Go 1.22.

v2023.1.6: Staticcheck 2023.1.6 (v0.4.6)

Compare Source

This release fixes the following bugs:

v2023.1.5: Staticcheck 2023.1.5 (v0.4.5)

Compare Source

This release fixes the following bug:

  • A crash involving methods named _

v2023.1.4: Staticcheck 2023.1.4 (v0.4.4)

Compare Source

This release adds support for Go 1.21 and fixes the following bugs:

  • Three crashes when encountering unnecessarily parenthesized statements (#​1393, #​1400)
  • Unnecessarily high memory usage when analyzing composite literals such as []int{1<<31: 1} (#​1393)
  • A false positive in S1011 when appending to a dynamic left-hand side (#​1399)
  • A crash involving generics (#​1410)
  • A false positive in SA9001 involving control flow statements (#​488)
  • A false positive in ST1003, complaining about the names of fuzz functions (#​1420)

v2023.1.3: Staticcheck 2023.1.3 (v0.4.3)

Compare Source

This release fixes the following bugs:

  • A crash when embedding type aliases of unnamed types (issue 1361)
  • A false positive in U1000, claiming that type aliases are unused (issue 1365)
  • A bug in the binary formatter that prevented correct merging behavior for some checks (issue 1372)

v2023.1.2: Staticcheck 2023.1.2 (v0.4.2)

Compare Source

This release fixes a bug that prevented the binary formatter from working (issue 1370).

v2023.1.1: Staticcheck 2023.1.1 (v0.4.1)

Compare Source

This release fixes a crash, a false positive in U1000 (issue 1360) and improves the way deprecated API is flagged (issue 1318).

When targeting a Go version that is older than the version that deprecated an API, SA1019 will no longer flag the use even if there is already an alternative available in the targeted Go version.

For example, math/rand.Seed has been deprecated in Go 1.20, but an alternative has existed since Go 1.0. In the past, we would flag uses of Seed even if targeting e.g. Go 1.19, to encourage better forwards compatibility. This can lead to unnecessary churn, however, because the correct change may depend on the Go version in use. For example, for Seed before Go 1.20, the alternative is to use a separate instance of math/rand.Rand, whereas in Go 1.20, a possible alternative is to simply drop the call to Seed.

v2023.1: Staticcheck 2023.1 (v0.4.0)

Compare Source

Staticcheck 2023.1 adds support for Go 1.20, brings minor improvements to various checks, and replaces U1000 with a new implementation.

The following checks have been improved:

  • The wording of S1001 has been made clearer for cases involving arrays. Furthermore, it no longer suggests using copy when the function has been shadowed.
  • S1011 now recognizes index-based loops (issue 881).
  • SA1019 no longer flags tests (internal or external) that use deprecated API from the package under test (issue 1285). Furthermore, entire declaration groups (such as groups of constants) can now be marked as deprecated (issue 1313).
  • SA4017 now detects more functions, including those in the time package (issue 1353). Additionally, its wording has been made clearer.
  • SA5010 no longer gets confused by type assertions involving generic types (issue 1354).
  • ST1005 no longer flags errors that start with alpha-numeric acronyms such as P384.
  • Improvements to our intermediate representation may allow various checks to find more problems.

Staticcheck now knows about version 2 of the k8s.io/klog package, in particular which functions abort control flow (issue 1307).

In addition to these minor improvements, U1000 has been rewritten from the ground up, operating on a program representation more suited to the task. In practice this means that there will be fewer false positives and more true positives.

Overall, the rewrite fixes at least eight known bugs, both ones that have been a nuisance for a while, as well as ones newly introduced by generics (issue 507, issue 633, issue 810, issue 812, issue 1199, issue 1249, issue 1282, issue 1333).

v2022.1.2: Staticcheck 2022.1.2 (v0.3.2)

Compare Source

This release addresses the following false positives, crashes, infinite loops, and performance issues:

  • For certain packages that contain tens of thousands of types and methods, such as those generated by ygot, Staticcheck now finishes much faster.
  • Several infinite loops when handling recursive type parameters have been fixed
  • S1009 no longer mistakes user-defined functions named len for the builtin (issue 1181)
  • ST1015 no longer reorders switch statements if their order is significant due to the use of fallthrough (issue 1188)
  • SA1013 now detects constants more robustly, avoiding both false negatives and false positives. Furthermore, it makes sure that offending methods implement io.Seeker and doesn’t just rely on the name Seek (issue 1213).
  • SA5008 now understands more third-party extensions to json struct tags
  • A crash involving functions named _ has been fixed (issue 1268)
  • A crash involving slicing type parameters of type string | []byte has been fixed (issue 1270)
  • SA1019 now handles imports of deprecated standard library packages in the same way it handles other deprecated API, taking the targeted Go version into consideration (issue 1117)

Additionally it is strongly recommended to use Go 1.18.2 for building Staticcheck, as it fixes further generics-related bugs in the type checker.

v2022.1.1: Staticcheck 2022.1.1 (v0.3.1)

Compare Source

This release addresses the following false positives, crashes, and infinite loops:

v2022.1: Staticcheck 2022.1 (v0.3.0)

Compare Source

Staticcheck 2022.1 adds support for Go 1.18 and generics, adds and tweaks some checks, and introduces the new -matrix and -merge flags.

Read the full release notes at https://staticcheck.io/changes/2022.1

v2021.1.2: Staticcheck 2021.1.2 (v0.2.2)

Compare Source

This release fixes some false positives and crashes.

Read the full release notes at https://staticcheck.io/changes/2021.1/#​2021.1.2

v2021.1.1: Staticcheck 2021.1.1 (v0.2.1)

Compare Source

This release adds support for new language features in Go 1.17, namely conversions from slices to array pointers, the unsafe.Add function, and the unsafe.Slice function.

Additionally, it fixes some false positives.

Read the full release notes at https://staticcheck.io/changes/2021.1#2021.1.1

v2021.1: Staticcheck 2021.1 (v0.2.0)

Compare Source

Read the full release notes at https://staticcheck.io/changes/2021.1

v2020.2.4: Staticcheck 2020.2.4 (v0.1.4)

Compare Source

This release fixes a crash and some false positives.

Read the full release notes at https://staticcheck.io/changes/2020.2#2020.2.4

v2020.2.3: Staticcheck 2020.2.3 (v0.1.3)

Compare Source

This release fixes a false positive in U1000. See #​942 for details.

v2020.2.2: Staticcheck 2020.2.2 (v0.1.2)

Compare Source

This release fixes a rare crash in Staticcheck, reduces the number of false positives, and adds support for Go 1.16's io/fs.FileMode type.

Read the full release notes at https://staticcheck.io/changes/2020.2#2020.2.2

v2020.2.1: Staticcheck 2020.2.1 (v0.1.1)

Compare Source

This release eliminates some false negatives as well as false positives, makes the staticcheck command less noisy and fixes a potential security issue.

See the full release notes at https://staticcheck.io/changes/2020.2#2020.2.1

v2020.2: Staticcheck 2020.2 (v0.1.0)

Compare Source

Read the full release notes at https://staticcheck.io/changes/2020.2

v2020.1.6: Staticcheck 2020.1.6

Compare Source

This release makes the following fixes and improvements:

  • Staticcheck no longer panics when encountering files that have the following comment: // Code generated DO NOT EDIT.
  • SA4016 no longer panics when checking bitwise operations that involve dot-imported identifiers.
  • Fixed the suggested fix offered by S1004.
  • Fixed a false positive involving byte arrays in SA5009.
  • Fixed a false positive involving named byte slice types in SA5009.
  • Added another heuristic to avoid flagging function names in error messages in ST1005.
  • SA3000 will no longer flag missing calls to os.Exit in TestMain functions if targeting Go 1.15 or newer.

v2020.1.5: Staticcheck 2020.1.5

Compare Source

This release fixes a crash in the pattern matching engine and a false positive in SA4006.

v2020.1.4: Staticcheck 2020.1.4

Compare Source

This release adds special handling for imports of the deprecated github.com/golang/protobuf/proto package.

github.com/golang/protobufhas deprecated the proto package, but their protoc-gen-go still imports the package and uses one of its constants, "to enforce a weak dependency on a sufficiently new version of the legacy package".

Staticcheck would flag the import of this deprecated package in all code generated by protoc-gen-go. Instead of forcing the project to change their project structure, we choose to ignore such imports in code generated by protoc-gen-go. The import still gets flagged in code not generated by protoc-gen-go.

You can find more information about this in the upstream issue.

v2020.1.3: Staticcheck 2020.1.3

Compare Source

This release fixes two bugs involving //lint:ignore directives:

  • When ignoring U1000 and checking a package that contains tests, Staticcheck would incorrectly complain that the linter directive didn't match any problems, even when it did.
  • On repeated runs, the position information for a "this linter directive didn't match anything" report would either be missing, or be wildly incorrect.

v2020.1.2: Staticcheck 2020.1.2

Compare Source

Staticcheck 2020.1(.2) contains UI improvements, speed enhancements,
numerous new and improved checks, and support for the upcoming Go
1.14.

Read the full release notes at https://staticcheck.io/changes/2020.1

(2020.1.2 differs from 2020.1.1 and 2020.1 in that it actually
displays the correct version information.)

v2019.2.3: Staticcheck 2019.2.3

Compare Source

Staticcheck 2019.2.3 is a re-release of 2019.2.2. Its pre-built binaries have been built with Go 1.13, to enable checking of code that uses language features introduced in Go 1.13.

v2019.2.2: Staticcheck 2019.2.2

Compare Source

Staticcheck 2019.2.2 contains the following user-visible fixes:

  • S1008 now skips if/else statements where both branches return the same value.
  • SA4006 now considers a value read when a switch statement reads it, even if the switch statement has no branches.
  • 2019.2 introduced a bug that made it impossible to enable non-default checks via configuration files. This is now possible again.
  • 2019.2 introduced a bug that made the -tags command line argument ineffective, making it impossible to pass in build tags. This is now possible again.
  • From this release onward, we will use pseudo versions of the form v0.0.1-<year>.<minor> instead of v0.0.0-<year>.<minor>. This fixes an issue where go get would prefer an older commit over a newer released version due to the way versions sort.

v2019.2.1: Staticcheck 2019.2.1

Compare Source

The 2019.2 release has an unfortunate bug that prevents staticcheck from running on 32-bit architectures, causing it to crash unconditionally. This release fixes that crash.

v2019.2: Staticcheck 2019.2

Compare Source

Staticcheck 2019.2 brings impressive performance improvements, many new and improved checks, and various small improvements to its command line.

Read the full changelog at https://staticcheck.io/changes/2019.2

v2019.1.1: Staticcheck 2019.1.1

Compare Source

The 2019.1.1 release fixes some minor bugs and improves the performance of the U1000 check:

  • The ST category of checks no longer flag style issues of aliased types when the aliased type exists in a package we aren't explicitly checking. This avoids crashes and erratic error reports.
  • Compiler errors now have correct position information.
  • A crash in the Stylish reporter has been fixed.
  • We no longer flag unused objects that belong to cgo internals.
  • The U1000 check has been optimized, reducing its memory usage and runtime.

v2019.1: Staticcheck 2019.1

Compare Source

Staticcheck 2019.1 makes some major changes to the structure of the tools. Please make sure to read the full changelog before deploying it.

v2017.2.2: Staticcheck 2017.2.2

Compare Source

Staticcheck 2017.2.2 fixes minor issues in unused, keyify and staticcheck:

  • unused: correctly apply the NoCopy exemption when using the -exported flag.
  • keyify: support external test packages (package foo_test)
  • staticcheck: disable SA4005 – the check, in its current form, is prone to false positives and will be reimplemented in a future release.

v2017.2.1: Staticcheck 2017.2.1

Compare Source

Staticcheck 2017.2.1 fixes a small bug in the detection of deprecated objects, because of course no release can go without bugs!

The (admittedly very short) full changelog:

  • Staticcheck 2017.2 made the detection of deprecated objects Go-version aware. Unfortunately, this only worked correctly for fields and methods, but not package-level objects. This release fixes that.

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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@dnwe dnwe merged commit 4c38778 into main Oct 14, 2025
17 checks passed
@dnwe dnwe deleted the mend/dominikh-go-tools-2025.x branch October 14, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants