Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: fails to return correct exit code when given directory as input #8792

Closed
dmitshur opened this issue Sep 23, 2014 · 3 comments
Closed
Milestone

Comments

@dmitshur
Copy link
Contributor

cmd/vet's docs (http://godoc.org/code.google.com/p/go.tools/cmd/vet) state the following:

> Vet's exit code is 2 for erroneous invocation of the tool, 1 if a problem was
reported, and 0 otherwise.

However, sometimes its exit code is 0 even when there are problems found. Specifically,
the exit code is always 0 whenever valid input that is a directory is given, regardless
if problems were reported or otherwise.

Thanks to Krzysztof (https://github.com/kjk) for originally discovering this issue.

The fix is relatively trivial so I will be submitting a CL that fixes this shortly.


What does 'go version' print?

go version go1.3.1 darwin/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. run `go tool vet ./some-directory-with-problems/`
2. run `echo $?`

What happened?

exit code: 0

What should have happened instead?

exit code: 1
@gopherbot
Copy link

Comment 1:

CL https://golang.org/cl/150850043 mentions this issue.

@griesemer
Copy link
Contributor

Comment 2:

Labels changed: added release-go1.4maybe, repo-tools.

Owner changed to @robpike.

@robpike
Copy link
Contributor

robpike commented Oct 2, 2014

Comment 3:

This issue was closed by revision golang/tools@cccd433.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned robpike Jun 23, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants