go/analysis/passes/shadow: add shadow command
In vet, the shadow check is experimental, meaning not on by default. The new analysis API has no concept of experimental, but you can easily supply a different checker. By providing a shadow command, we make it easy for users that want it to run it: $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow $ go vet -vettool $(which shadow) my/project Change-Id: I25dc7f3c830296121c7217e4615e8ff90e1b7c79 Reviewed-on: https://go-review.googlesource.com/c/148565 Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
parent
5b8b0ce6cc
commit
77439c5518
|
@ -0,0 +1,9 @@
|
|||
// The shadow command runs the shadow analyzer.
|
||||
package main
|
||||
|
||||
import (
|
||||
"golang.org/x/tools/go/analysis/passes/shadow"
|
||||
"golang.org/x/tools/go/analysis/singlechecker"
|
||||
)
|
||||
|
||||
func main() { singlechecker.Main(shadow.Analyzer) }
|
Loading…
Reference in New Issue