github.com/nozzle/golangci-lint@v1.49.0-nz3/pkg/golinters/typecheck.go (about)

     1  package golinters
     2  
     3  import (
     4  	"golang.org/x/tools/go/analysis"
     5  
     6  	"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
     7  )
     8  
     9  func NewTypecheck() *goanalysis.Linter {
    10  	const linterName = "typecheck"
    11  
    12  	analyzer := &analysis.Analyzer{
    13  		Name: linterName,
    14  		Doc:  goanalysis.TheOnlyanalyzerDoc,
    15  		Run:  goanalysis.DummyRun,
    16  	}
    17  
    18  	return goanalysis.NewLinter(
    19  		linterName,
    20  		"Like the front-end of a Go compiler, parses and type-checks Go code",
    21  		[]*analysis.Analyzer{analyzer},
    22  		nil,
    23  	).WithLoadMode(goanalysis.LoadModeTypesInfo)
    24  }