golangci-lint/pkg/golinters/exhaustivestruct.go
Mateusz Bilski c57627b18c
Add exhaustivestruct linter (#1411)
* Add exhaustivestruct linter

* CHange load mode to types info

* Fix go.mod
2020-10-12 08:35:02 +02:00

18 lines
429 B
Go

package golinters
import (
"github.com/mbilski/exhaustivestruct/pkg/analyzer"
"golang.org/x/tools/go/analysis"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewExhaustiveStruct() *goanalysis.Linter {
return goanalysis.NewLinter(
"exhaustivestruct",
"Checks if all struct's fields are initialized",
[]*analysis.Analyzer{analyzer.Analyzer},
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}