cmd/vet: fix bug where incorrect exit code was returned

Fixes golang/go#8792.

This is a simple change that fixes the issue. It may be desireable
to opt for a larger code change that makes this problem less likely
to be inadvertedly reintroduced in the future. For instance, a vetMain()
func can be used similar to gofmtMain(), or the os.Exit call can be
deferred.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/150850043
This commit is contained in:
Dmitri Shuralyov 2014-10-02 10:33:35 -07:00 committed by Rob Pike
parent 59d8afa26b
commit cccd43354a
1 changed files with 1 additions and 1 deletions

View File

@ -245,7 +245,7 @@ func main() {
for _, name := range flag.Args() {
walkDir(name)
}
return
os.Exit(exitCode)
}
if !doPackage(".", flag.Args()) {
warnf("no files checked")