-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Wrong if condition in schemas.go #147
Comments
Thanks for the report! You are correct that |
lukedirtwalker
added a commit
to lukedirtwalker/go-capnproto2
that referenced
this issue
Aug 12, 2019
The error is assigned to r.err but checked is err, fix this by checking r.err. Found with nilness analyzer. Fixes capnproto#147
@zombiezen opened #148 |
lukedirtwalker
added a commit
to lukedirtwalker/go-capnproto2
that referenced
this issue
Aug 12, 2019
The error is assigned to r.err but checked is err, fix this by checking r.err. Found with nilness analyzer. Fixes capnproto#147 Also delete unreachable return nil in marshal.go
zombiezen
pushed a commit
that referenced
this issue
Aug 13, 2019
The error is assigned to r.err but checked is err, fix this by checking r.err. Found with nilness analyzer. Also delete unreachable return nil in encoding/text/marshal.go. Fixes #147
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following if condition
https://github.com/capnproto/go-capnproto2/blob/4a2d721f0c4b15f3e369dc4a82d604ef605d7da5/schemas/schemas.go#L114-L115
is wrong. The error is assigned to
r.err
but the check below is onerr
which was previously checked.Not sure what the correct solution would be, probably the if should just check for
r.err
, or is the assignment tor.err
wrong in the first place?Found with go nilness analyzer (https://godoc.org/golang.org/x/tools/go/analysis/passes/nilness)
The text was updated successfully, but these errors were encountered: