Skip to content

Releases: dominikh/go-tools

Staticcheck 2023.1 (v0.4.0)

03 Feb 02:18
2023.1
Compare
Choose a tag to compare

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).

Staticcheck 2022.1.3 (v0.3.3)

29 Jul 02:14
v0.3.3
Compare
Choose a tag to compare

This release addresses the following issues:

  • Staticcheck maintains a cache to speed up repeated runs. This cache needs to be pruned regularly to keep its size in check. This is meant to happen automatically, but it hasn’t since Staticcheck 2020.2. This release corrects that (issue 1283.)
  • Some type sets containing both bidirectional and unidirectional channels would lead to panics (issue 1304)

Staticcheck 2022.1.2 (v0.3.2)

17 May 11:32
2022.1.2
Compare
Choose a tag to compare

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.

Staticcheck 2022.1.1 (v0.3.1)

24 Apr 01:49
2022.1.1
Compare
Choose a tag to compare

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

Staticcheck 2022.1 (v0.3.0)

30 Mar 00:59
2022.1
Compare
Choose a tag to compare

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

Staticcheck 2021.1.2 (v0.2.2)

11 Nov 14:27
2021.1.2
Compare
Choose a tag to compare

This release fixes some false positives and crashes.

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

Staticcheck 2021.1.1 (v0.2.1)

16 Aug 23:41
2021.1.1
Compare
Choose a tag to compare

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

Staticcheck 2021.1 (v0.2.0)

25 May 14:43
2021.1
Compare
Choose a tag to compare

Staticcheck 2020.2.4 (v0.1.4)

01 May 22:12
2020.2.4
Compare
Choose a tag to compare

This release fixes a crash and some false positives.

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

Staticcheck 2020.2.3 (v0.1.3)

09 Mar 13:57
2020.2.3
Compare
Choose a tag to compare

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