encoding/json: Number no longer accepts invalid numbers #37515
Closed
Labels
Milestone
Comments
It appears that this has been discussed pretty thoroughly, if it is to remain that's ok but if I could request the release notes or somewhere there could be documentation demonstrating the fix or showing the use of an alternative like |
Hey @deankarn. As you mentioned, this was discussed in #37308. The release notes contain documentation noting the change. I'm going to close this issue. if you feel like this was closed in error please comment below. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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?
I decoded an empty string into a
json.Number
https://play.golang.org/p/BasiDL88-1O
What did you expect to see?
What did you see instead?
I realize that this was done on purpose and released in 1.14 and it technically doesn't break the Go1 compatibility promise, however, it is a big behavioural breaking change and am hoping it can be reverted.
I cannot speak for the rest of the community but I know many instances where
json.Number
was specifically used for this very behaviour and now would require code changes to get the same behaviour back; code changes to code that we may not even own.It was also used because it was a std lib type that supported this behaviour that didn't pull in or make another dependency that caused abstraction leakage.
The text was updated successfully, but these errors were encountered: