1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:28:32 -06:00

go/analysis/unitchecker: improve error message for go tool vet

Previously running "go tool vet" said

vet: invalid command: want .cfg file (this reduced version of vet is
intended to be run only by the 'go vet' command)

With this change it says:

vet: invoking "go tool vet" directly is unsupported; use "go vet"

Updates golang/go#28869

Change-Id: I603ab2f75bb52d860e5cd7466e89d051dfbf3f08
Reviewed-on: https://go-review.googlesource.com/c/152217
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Ian Lance Taylor 2018-12-03 11:35:20 -08:00 committed by Alan Donovan
parent ee45598d2f
commit 99b2a93e1f

View File

@ -112,7 +112,7 @@ Usage of %[1]s:
os.Exit(0)
}
if len(args) != 1 || !strings.HasSuffix(args[0], ".cfg") {
log.Fatalf("invalid command: want .cfg file (this reduced version of %s is intended to be run only by the 'go vet' command)", progname)
log.Fatalf(`invoking "go tool vet" directly is unsupported; use "go vet"`)
}
Run(args[0], analyzers)
}