vetgen
creates vettool with own analyzers.
$ go get -u github.com/gostaticanalysis/vetgen
$ vetgen init myvet
$ cat myvet/main.go
// This file is generated by vetgen.
// Do NOT modify this file.
//
// You can run this tool with go vet such as:
// go vet -vettool=$(which myvet) pkgname
package main
// go vet
import (
"golang.org/x/tools/go/analysis/unitchecker"
"github.com/gostaticanalysis/vetgen/analyzers"
)
var myAnayzers = []*analysis.Analyzer {}
func main() {
unitchecker.Main(append(
analyzers.Recommend(),
myAnayzers...,
)
}
$ cd myvet
$ vetgen add github.com/tenntenn/mychecker
$ cat main.go
// This file is generated by vetgen.
// Do NOT modified this file.
package main
// go vet
import (
"golang.org/x/tools/go/analysis/unitchecker"
"github.com/gostaticanalysis/vetgen/analyzers"
"github.com/tenntenn/mychecker" // add by vetgen
)
var myAnayzers = []*analysis.Analyzer {
mychecker.Analyzer,
}
func main() {
unitchecker.Main(append(
analyzers.Recommend(),
myAnayzers...,
)
}
$ go vet -vettool=$(which myvet) fmt