aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vet/main.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-10-25 15:49:00 -0400
committerRuss Cox <rsc@golang.org>2016-10-25 20:42:01 +0000
commita850dbdef2f1875d81ad09024480f648ce3eac32 (patch)
tree3df581d5b78cfb0f1ddc90815a2fcf179d294ec6 /src/cmd/vet/main.go
parente24ccfc6fc6289073cdbe6f47f8a915e798578e9 (diff)
downloadgo-a850dbdef2f1875d81ad09024480f648ce3eac32.tar.gz
go-a850dbdef2f1875d81ad09024480f648ce3eac32.zip
cmd/vet: accept space-separated tag lists for compatibility with cmd/go
Fixes #17148. Change-Id: I4c66aa0733c249ee6019d1c4e802a7e30457d4b6 Reviewed-on: https://go-review.googlesource.com/32030 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/cmd/vet/main.go')
-rw-r--r--src/cmd/vet/main.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go
index 8149ba04e0..3da0b3ccf5 100644
--- a/src/cmd/vet/main.go
+++ b/src/cmd/vet/main.go
@@ -25,7 +25,7 @@ import (
var (
verbose = flag.Bool("v", false, "verbose")
- tags = flag.String("tags", "", "comma-separated list of build tags to apply when parsing")
+ tags = flag.String("tags", "", "space-separated list of build tags to apply when parsing")
tagList = []string{} // exploded version of tags flag; set in main
)
@@ -208,7 +208,10 @@ func main() {
}
}
- tagList = strings.Split(*tags, ",")
+ // Accept space-separated tags because that matches
+ // the go command's other subcommands.
+ // Accept commas because go tool vet traditionally has.
+ tagList = strings.Fields(strings.Replace(*tags, ",", " ", -1))
initPrintFlags()
initUnusedFlags()