golangci-lint/test/testdata/staticcheck.go
Isaev Denis 6a979fb40d
Update staticcheck and cache go/analysis facts (#699)
* 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.
2019-09-17 08:42:16 +03:00

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"
}