
Some checks failed
Extra / Vulnerability scanner (push) Has been cancelled
CI / go-mod (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Release a tag / release (push) Has been cancelled
CI / tests-on-windows (push) Has been cancelled
CI / tests-on-macos (push) Has been cancelled
CI / tests-on-unix (1.14) (push) Has been cancelled
CI / tests-on-unix (1.15) (push) Has been cancelled
CI / tests-on-unix (1.16) (push) Has been cancelled
CI / check_generated (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile.alpine]) (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile]) (push) Has been cancelled
29 lines
603 B
Go
29 lines
603 B
Go
package golinters
|
|
|
|
import (
|
|
"golang.org/x/tools/go/analysis"
|
|
|
|
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
|
|
)
|
|
|
|
func NewTypecheck() *goanalysis.Linter {
|
|
const linterName = "typecheck"
|
|
|
|
analyzer := &analysis.Analyzer{
|
|
Name: linterName,
|
|
Doc: goanalysis.TheOnlyanalyzerDoc,
|
|
Run: func(pass *analysis.Pass) (interface{}, error) {
|
|
return nil, nil
|
|
},
|
|
}
|
|
|
|
linter := goanalysis.NewLinter(
|
|
linterName,
|
|
"Like the front-end of a Go compiler, parses and type-checks Go code",
|
|
[]*analysis.Analyzer{analyzer},
|
|
nil,
|
|
).WithLoadMode(goanalysis.LoadModeTypesInfo)
|
|
|
|
return linter
|
|
}
|