-
Notifications
You must be signed in to change notification settings - Fork 29
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
Named return values not reported #13
Comments
G'day, thanks a lot for the report. This particular example is actually not expected to be wrapped, as calls to Secondly, the call to However, you did bring up a good point with regards to named return values. I have been able to make a similar example which in fact should be wrapped and is not reported. The example is below: package main
import "encoding/json"
func main() {
do()
}
func do() (err error) {
err = json.Unmarshal([]byte(""), nil)
return // TODO want `error returned from external package is unwrapped`
} You can see that the error returned by a call to a separate package func I've written a test case that fails. If you're interesting in contributing a solution that would be massively appreciated, as my time at the moment is a bit on the short side. Cheers |
The test case was added in commit: e75cc2a behind a TODO. |
@tomarrell Awesome! Thanks for taking a look. Indeed, if I find time, I'll take a crack at a PR, but my repos are demanding time too 😅. I guess we'll see who gets time first. Cheers! |
Try this out
You'll see that wrap check does not detect that
err
is not being wrapped.The text was updated successfully, but these errors were encountered: