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
		
			
				
	
	
		
			20 lines
		
	
	
		
			461 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			461 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package golinters
 | 
						|
 | 
						|
import (
 | 
						|
	"honnef.co/go/tools/staticcheck"
 | 
						|
 | 
						|
	"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
 | 
						|
)
 | 
						|
 | 
						|
func NewStaticcheck() *goanalysis.Linter {
 | 
						|
	analyzers := analyzersMapToSlice(staticcheck.Analyzers)
 | 
						|
	setAnalyzersGoVersion(analyzers)
 | 
						|
 | 
						|
	return goanalysis.NewLinter(
 | 
						|
		"staticcheck",
 | 
						|
		"Staticcheck is a go vet on steroids, applying a ton of static analysis checks",
 | 
						|
		analyzers,
 | 
						|
		nil,
 | 
						|
	).WithLoadMode(goanalysis.LoadModeTypesInfo)
 | 
						|
}
 |