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: warn about ignored error results #4045

campoy opened this issue Sep 6, 2012 · 2 comments


None yet
3 participants
Copy link

commented Sep 6, 2012

With this code:

package main

func Do() error {
        return nil

func main() {

I would like go vet to warn me that in the Do() call I'm implicitly ignoring the
returned error. This makes sense since if Do returned anything else than the error I
would be forced to explicitly ignore the error (or handle it).

I understand this could be very noisy for fmt.*, so that package may be completely
blacklisted from the check. On the other hand, this feature could avoid some common
errors while using third party libs.

This comment has been minimized.

Copy link

commented Sep 6, 2012

Comment 1:

[Please use the standard summary form.]
I am skeptical about this. Every time I've seen this tried in other languages there have
been far too many false positives. Not all errors are worth checking.

This comment has been minimized.

Copy link

commented Sep 12, 2012

Comment 2:

On more thought I'm almost certain this is working as intended.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 24, 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.