
* update staticcheck Don't fork staticcheck: use the upstream version. Remove unneeded SSA loading. * Cache go/analysis facts Don't load unneeded packages for go/analysis. Repeated run of go/analysis linters now 10x faster (2s vs 20s on this repo) than before.
26 lines
409 B
Go
26 lines
409 B
Go
//args: -Estaticcheck
|
|
package testdata
|
|
|
|
import (
|
|
"runtime"
|
|
)
|
|
|
|
func Staticcheck() {
|
|
var x int
|
|
x = x // ERROR "self-assignment of x to x"
|
|
}
|
|
|
|
func StaticcheckNolintStaticcheck() {
|
|
var x int
|
|
x = x //nolint:staticcheck
|
|
}
|
|
|
|
func StaticcheckNolintMegacheck() {
|
|
var x int
|
|
x = x //nolint:megacheck
|
|
}
|
|
|
|
func StaticcheckDeprecated() {
|
|
_ = runtime.CPUProfile() // ERROR "SA1019: runtime.CPUProfile is deprecated"
|
|
}
|