encoding/json: Unintuitive behavior when using custom UnmarshalText #38947
Labels
Milestone
Comments
This sounds like a duplicate of #38105, which has a fix in master that will be backported for 1.14.3. |
I can confirm that the tests from https://play.golang.org/p/V7qY2khOcgH pass on master, so this is a duplicate of the issue above. Follow #38106 for the backport to 1.14.3. |
Thanks @mvdan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it even seems like it was introduced somewhere between
go1.13.9
andgo1.14.2
.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was trying to Unmarshal a JSON body containing
\n
into amap[String]string
whereString
isTextUnmarshaler
:JSON body:
An example can be found here: https://play.golang.org/p/V7qY2khOcgH
Note, my key issue is the difference in behavior between the two maps in the playground example.
What did you expect to see?
A normal map without escaped quotes. Which is the result of using a
map[string]string
instead of amap[String]string
.What did you see instead?
Escaped quotes in the map keys. As if the key wasn't properly tokenized.
The text was updated successfully, but these errors were encountered: