golangci-lint/test/testdata/staticcheck.go
2022-08-15 21:56:32 +02:00

28 lines
452 B
Go

//golangcitest:args -Estaticcheck
package testdata
import (
"fmt"
)
func Staticcheck() {
var x int
x = x // ERROR "self-assignment of x to x"
fmt.Printf("%d", x)
}
func StaticcheckNolintStaticcheck() {
var x int
x = x //nolint:staticcheck
}
func StaticcheckNolintMegacheck() {
var x int
x = x //nolint:megacheck
}
func StaticcheckPrintf() {
x := "dummy"
fmt.Printf("%d", x) // ERROR "SA5009: Printf format %d has arg #1 of wrong type"
}