so it should be used as guidance only, not as a firm indicator of
program correctness.
-By default all checks are performed. If any flags are explicitly set
-to true, only those tests are run. Conversely, if any flag is
-explicitly set to false, only those tests are disabled.
-Thus -printf=true runs the printf check, -printf=false runs all checks
-except the printf check.
+By default the -all flag is set so all checks are performed.
+If any flags are explicitly set to true, only those tests are run. Conversely, if
+any flag is explicitly set to false, only those tests are disabled. Thus -printf=true
+runs the printf check, -printf=false runs all checks except the printf check.
Available checks:
-shadowstrict
Whether to be strict about shadowing; can be noisy.
*/
-package main // import "golang.org/x/tools/cmd/vet"
+package main
func (ts *triState) String() string {
switch *ts {
case unset:
- return "unset"
+ return "true" // An unset flag will be set by -all, so defaults to true.
case setTrue:
return "true"
case setFalse:
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
fmt.Fprintf(os.Stderr, "\tvet [flags] directory...\n")
fmt.Fprintf(os.Stderr, "\tvet [flags] files... # Must be a single package\n")
+ fmt.Fprintf(os.Stderr, "By default, -all is set and all non-experimental checks are run.\n")
fmt.Fprintf(os.Stderr, "For more information run\n")
fmt.Fprintf(os.Stderr, "\tgo doc cmd/vet\n\n")
fmt.Fprintf(os.Stderr, "Flags:\n")