golangci-lint/test/testdata/nolintlint_unused.go
Andrew Shannon Brown 909f628d75 Add linter for nolint
Linter can check that nolint statements are properly formatted and also that all
nolint statements are used.
2020-04-26 20:20:17 -07:00

12 lines
431 B
Go

//args: -Enolintlint -Evarcheck
//config: linters-settings.nolintlint.allow-unused=false
package testdata
import "fmt"
func Foo() {
fmt.Println("unused") //nolint // ERROR "directive `//nolint .*` is unused"
fmt.Println("unused,specific") //nolint:varcheck // ERROR "directive `//nolint:varcheck .*` is unused for linter varcheck"
fmt.Println("not run") //nolint:unparam // unparam is not run so this is ok
}