I wrote a small main
file to test out golangci linters
package main
import "fmt"
type AB struct {
A string
B string
}
func main() {
s := AB{
B: "hello",
}
fmt.Println(s)
}
Field A
is unused and should be reported by structcheck
linter which is enabled by default.
structcheck: Finds unused struct fields [fast: false, auto-fix: false]
Calling golangci-lint run
, I don’t get any report on the unused field.
Same with golangci-lint run -E structcheck
Could someone please clarify what I’m doing wrong? Thanks