mirror of
https://github.com/golang/go
synced 2024-11-13 19:20:31 -07:00
cmd/vet: remove -test flag
-test flag is a testing only flag that enables all vet checks. It was needed because there was no way to run all vet checks in a single command invocation. However it is possible to do this now by combining -all and -shadow flags. Also a recently added -tests flag is similarly named, having both -test and -tests can be confusing. Change-Id: Ie5bacbe0bef5c8409eeace46f16141fa4e782c32 Reviewed-on: https://go-review.googlesource.com/20006 Reviewed-by: Rob Pike <r@golang.org> Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
bcce5bdabd
commit
b8a2e25f55
@ -198,7 +198,5 @@ These flags configure the behavior of vet:
|
||||
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"
|
||||
|
@ -24,10 +24,9 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
@ -116,9 +115,6 @@ func (ts triState) IsBoolFlag() bool {
|
||||
|
||||
// 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()
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,8 @@ func Vet(t *testing.T, files []string) {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user