golangci-lint/pkg/golinters/stylecheck.go
Isaev Denis 95ec0cf21e
dramatically reduce memory usage (#758)
Run all linters per package. It allows unloading package data when it's
processed. It dramatically reduces memory (and CPU because of GC) usage.

Relates: #337
2019-09-30 16:19:41 +03:00

20 lines
418 B
Go

package golinters
import (
"honnef.co/go/tools/stylecheck"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewStylecheck() *goanalysis.Linter {
analyzers := analyzersMapToSlice(stylecheck.Analyzers)
setAnalyzersGoVersion(analyzers)
return goanalysis.NewLinter(
"stylecheck",
"Stylecheck is a replacement for golint",
analyzers,
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}