-
Notifications
You must be signed in to change notification settings - Fork 192
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
First pass of #67 - Let the shim functions return an error #182
Conversation
if b.ShimMode == Cast { | ||
d.p.printf("\n%s = %s(%s)\n}", vname, b.FromBase(), tmp) | ||
} else { | ||
d.p.printf("\n%s, err = %s(%s)\n}", vname, b.FromBase(), tmp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you're generating code that shadows err
without checking it first.
gen/unmarshal.go
Outdated
if b.ShimMode == Cast { | ||
u.p.printf("\n%s = %s(%s)\n", b.Varname(), b.FromBase(), refname) | ||
} else { | ||
u.p.printf("\n%s, err = %s(%s)\n", b.Varname(), b.FromBase(), refname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you've got the same err
shadowing problem here.
Thanks for the PR. I made a few inline comments, but overall this looks pretty good. I wonder whether or not this should be a new directive, since |
Thanks heaps for the comments, can't believe I missed that error thing 😳, should be fixed now. I started out making it a separate directive but it shared so much of the same mechanics as I'm not really fussed one way or the other. If you reckon it should be a separate directive, I'll dive back in and clean it up for you, no problem. |
Would you like me to update this to use a different directive? |
Sorry for the slow review time. Looks Good. Thanks again for the PR. |
Awesome, thanks! |
This change is