For more information, see the discussion of the -printf flag.
-shadowstrict
Whether to be strict about shadowing; can be noisy.
- -test
- For testing only: sets -all and -shadow.
*/
package main // import "golang.org/x/tools/cmd/vet"
)
var (
- verbose = flag.Bool("v", false, "verbose")
- testFlag = flag.Bool("test", false, "for testing only: sets -all and -shadow")
- tags = flag.String("tags", "", "comma-separated list of build tags to apply when parsing")
- tagList = []string{} // exploded version of tags flag; set in main
+ verbose = flag.Bool("v", false, "verbose")
+ tags = flag.String("tags", "", "comma-separated list of build tags to apply when parsing")
+ tagList = []string{} // exploded version of tags flag; set in main
)
var exitCode = 0
// vet tells whether to report errors for the named check, a flag name.
func vet(name string) bool {
- if *testFlag {
- return true
- }
return report[name].isTrue()
}
flags := []string{
"./" + binary,
"-printfuncs=Warn:1,Warnf:1",
- "-test", // TODO: Delete once -shadow is part of -all.
+ "-all",
+ "-shadow",
}
cmd := exec.Command(errchk, append(flags, files...)...)
if !run(cmd, t) {