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
Add GetUnderlying function to ErrorWithPos #260
Conversation
Hi! That’s a nice feature, but you should take a look at the current developments in Go. The next release (Go 1.13) will have |
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.
Good catch.
Since this PR isn't actually released, it may be nice to rename the method to |
@pedgeio, simply renaming |
Yea I'm down with that, want me to put up a PR or can you push it quickly? |
Do you mind? I actually have some other changes I'm working on at the moment and don't want to get side-tracked. If you don't have a chance, I can get to it later today. |
Yep I'll do it right now |
I need access to the underlying error without any source information, this exposes it. Everything works if you just add the function, I added specific tests cases as well though.
This effectively makes ErrorWithPos equal to the old ErrorWithSourcePos in terms of what it exposes, but as an interface.