summaryrefslogtreecommitdiff
path: root/src/cmd/vet/doc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/vet/doc.go')
-rw-r--r--src/cmd/vet/doc.go20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/cmd/vet/doc.go b/src/cmd/vet/doc.go
index 620964aaf..f164eaca2 100644
--- a/src/cmd/vet/doc.go
+++ b/src/cmd/vet/doc.go
@@ -9,9 +9,12 @@ calls whose arguments do not align with the format string. Vet uses heuristics
that do not guarantee all reports are genuine problems, but it can find errors
not caught by the compilers.
+By default all checks are performed, but if explicit flags are provided, only
+those identified by the flags are performed.
+
Available checks:
-1. Printf family
+1. Printf family, flag -printf
Suspicious calls to functions in the Printf family, including any functions
with these names:
@@ -28,24 +31,29 @@ complains about arguments that look like format descriptor strings.
It also checks for errors such as using a Writer as the first argument of
Printf.
-2. Methods
+2. Methods, flag -methods
Non-standard signatures for methods with familiar names, including:
Format GobEncode GobDecode MarshalJSON MarshalXML
- Peek ReadByte ReadFrom ReadRune Scan Seek
+ Peek ReadByte ReadFrom ReadRune Scan Seek
UnmarshalJSON UnreadByte UnreadRune WriteByte
WriteTo
-3. Struct tags
+3. Struct tags, flag -structtags
Struct tags that do not follow the format understood by reflect.StructTag.Get.
+4. Untagged composite literals, flag -composites
+
+Composite struct literals that do not use the type-tagged syntax.
+
+
Usage:
go tool vet [flag] [file.go ...]
go tool vet [flag] [directory ...] # Scan all .go files under directory, recursively
-The flags are:
+The other flags are:
-v
Verbose mode
-printfuncs
@@ -59,4 +67,4 @@ The flags are:
-printfuncs=Warn:1,Warnf:1
*/
-package documentation
+package main