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

dmitshur opened this issue Sep 23, 2014 · 3 comments


None yet
5 participants
Copy link

commented Sep 23, 2014

cmd/vet's docs ( 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 ( 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

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

This comment has been minimized.

Copy link

commented Sep 23, 2014

Comment 1:

CL mentions this issue.

This comment has been minimized.

Copy link

commented Oct 1, 2014

Comment 2:

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

Owner changed to @robpike.


This comment has been minimized.

Copy link

commented Oct 2, 2014

Comment 3:

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

Status changed to Fixed.

@dmitshur dmitshur added fixed labels Oct 2, 2014

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015

@rsc rsc removed the release-go1.4maybe label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.