| 1 |
--- |
| 2 |
title: Staticcheck 2026.1 release notes |
| 3 |
linkTitle: "2026.1 (v0.7.0)" |
| 4 |
weight: -11 |
| 5 |
--- |
| 6 |
|
| 7 |
## Improved Go 1.25 and Go 1.26 support |
| 8 |
|
| 9 |
This release updates Staticcheck’s database of deprecated standard library APIs |
| 10 |
to cover the Go 1.25 and Go 1.26 releases, as well as to add some |
| 11 |
`crypto/elliptic` deprecations from Go 1.21 that were missing. Furthermore, it |
| 12 |
adds support for `new(expr)`, which was added in Go 1.26. |
| 13 |
|
| 14 |
## Other changes |
| 15 |
|
| 16 |
- Version mismatch checks have been relaxed and no longer care about mismatches |
| 17 |
in the patch level. For example, Staticcheck built with Go 1.26.0 will be able |
| 18 |
to check code using Go 1.26.1. |
| 19 |
- Staticcheck no longer opens `staticcheck.conf` files that aren't regular files |
| 20 |
(or symlinks to regular files). See [this gomodfs |
| 21 |
issue](https://github.com/tailscale/gomodfs/issues/17) for the motivation |
| 22 |
behind this change. |
| 23 |
- Staticcheck now exits with a non-zero status code if it encountered an |
| 24 |
invalid configuration file. |
| 25 |
|
| 26 |
## Checks |
| 27 |
|
| 28 |
### Changed checks |
| 29 |
|
| 30 |
The following checks have been improved: |
| 31 |
|
| 32 |
- {{< check "SA1026" >}} no longer panics when checking code that tries to |
| 33 |
marshal named functions ({{< issue "1660" >}}). |
| 34 |
- {{< check "SA4000" >}} no longer flags `var _ = T{} == T{}`, a pattern used to |
| 35 |
ensure that type `T` is comparable ({{< issue "1670" >}}). |
| 36 |
- {{< check "SA4000" >}} now correctly skips structs containing floats. |
| 37 |
- {{< check "SA4000" >}} now skips functions from the `math/rand/v2` package. |
| 38 |
- {{< check "SA4003" >}} now skips over generated files. |
| 39 |
- {{< check "SA4030" >}} now also checks uses of `math/rand/v2`. |
| 40 |
- {{< check "SA5008" >}} has been updated with better support for `encoding/json/v2`. |
| 41 |
- {{< check "SA5010" >}} no longer tries to reason about generics, to avoid |
| 42 |
false positives. |
| 43 |
- {{< check "ST1019" >}} no longer flags duplicate imports of unsafe, mainly to |
| 44 |
play nice with cgo. |
| 45 |
- {{< check "ST1003" >}} and {{< check "QF1002" >}} now emit more concise |
| 46 |
positions, benefitting users of gopls ({{< issue 1647 >}}). |
| 47 |
- {{< check "ST1019" >}} now allows importing the same package twice, once using |
| 48 |
a blank import ({{< issue "1688" >}}). |
| 49 |
- {{< check "QF1008" >}} no longer offers to delete all embedded fields from a |
| 50 |
selector expression. Even when two fields are individually superfluous, |
| 51 |
removing both might change the semantics of the code ({{< issue "1682" >}}). |
| 52 |
- {{< check "QF1012" >}} now detects more uses of `bytes.Buffer` ({{< issue "1097" >}}). |
| 53 |
- A bug in the intermediate representation was fixed, affecting the behavior of |
| 54 |
various checks ({{< issue "1654" >}}). |