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
database/sql: Rows.Scan does not use the %w verb when wrapping errors #38099
Comments
Now that 1.12 is no longer supported, I think we can make this change. What do you think, @jba? |
I'm for it. But this is technically breaking change, since anyone since 1.13 who was doing |
Hm. I’m not a fan of breaking changes. Will follow up. This needs more investigation. |
I don’t think this is a breaking change. It’s a behavioral change, and any behavioral change is of course subject to Hyrum’s Law, but I don’t believe this changes the documented properties of the package’s errors. |
@jba @andybons: I’m not sure how this would be interpreted as a breaking change. Because If developers are currently using In fact, with the introduction of Someone might argue that these errors shouldn’t be wrapped because this is exposing the internal details of the |
I'm agreeing with @sfllaw's conclusion.
https://play.golang.org/p/uxpnS97ASZf One of the affected use cases would be implementers of the
Using the above pattern, I would expect to can do something like:
|
I think we should do this. I expect that this will break some tests using I don't expect any breakage from code using |
sgtm. marking as early-in-cycle |
This issue is currently labeled as early-in-cycle for Go 1.16. |
I'm working now on a CL, should submit in the next hour or so. |
Change https://golang.org/cl/248337 mentions this issue: |
@muhlemmer Suggestion: we should document how the Scanner's error propagates through the stack. |
Ok, I will adapt the documentation and amend the change later today.
…On 13 August 2020 12:26:23 EEST, Simon Law ***@***.***> wrote:
@muhlemmer Suggestion: we should document how the Scanner's error
propagates through the stack.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#38099 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
database/sql.Rows.Scan does not use the %w verb when wrapping errors:
go/src/database/sql/sql.go
Line 3078 in 8cb865c
Here is a motivating example involving a custom type that implements database/sql.Scanner:
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: