]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vet: remove -test flag
authorKonstantin Shaposhnikov <k.shaposhnikov@gmail.com>
Tue, 1 Mar 2016 14:55:06 +0000 (22:55 +0800)
committerRob Pike <r@golang.org>
Mon, 7 Mar 2016 22:54:38 +0000 (22:54 +0000)
-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>

src/cmd/vet/doc.go
src/cmd/vet/main.go
src/cmd/vet/vet_test.go

index bb3238fc9ed46e21151315a59b308c063537f366..d295fb434590648d8e697e3b95f53f6f10780c3b 100644 (file)
@@ -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"
index c401fed0b4d20b0de870932702cf449c819f2ef6..12000867aefdad7c56e36956b22afb6b1eb0e860 100644 (file)
@@ -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()
 }
 
index 20d72de313531c19c713e84928509d7b218b24b4..372ac2846bf9e46483796bb5a17016ec6cb08786 100644 (file)
@@ -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) {