-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/xml: Unmarshal ignores error return from Decoder.unmarshalAttr #16158
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
Comments
The offending commit (if it's in any way relevant to why the return value of I can submit a CL with with either fix 1 or fix 2 if you'd like. The more I think about it, option 1 sounds less attractive and option 2 more correct. |
The fix is to change This has worked this way since 1.0.3, so leaving for 1.8. |
Is this covered under the Go 1.0 promise? (Curious since this has been the behavior for ~7 releases, even though it's obviously incorrect.)
|
This kind of thing is not strictly covered by the Go 1 promise. We are permitted to fix bugs. However, if fixing this bug causes packages to fail, we might decide that it's not worth fixing. |
Okay, I'll go ahead with the CL then. I noticed the failed test too—is that
|
I'm not quite sure what you are asking. Certainly all the tests must pass when the CL is committed. |
Yes, of course. The failing test could be indicative of another bug in the xml package, or My question was about the former and whether it'd require a separate
|
CL https://golang.org/cl/27455 mentions this issue. |
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6.2
go env
)?GOOS=GNU/Linux
GOARCH=amd64
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
https://play.golang.org/p/wAByp2MpkB
One of two things, in order of preference:
1.) SinceC
is one byte long I'd expect to seefoo.B
set to 0x43 (and also error out if the attribute is longer than one byte long.)2.) An error since
C
is an invalid number andDecoder.unmarshalAttr
callsstrconv.ParseUint
yet decides to ignore the return value ofcopyValue
.Nothing -- it doesn't touch
foo.B
andfoo.B
remains 0x0.The text was updated successfully, but these errors were encountered: