encoding/json: Unmarshal replaces interface{} types instead of acting on the underlying type #20994
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
Unmarshal to existing
map[string]interface{}
that is hidden behind aninterface{}
:https://play.golang.org/p/kgaRznDOwb
What did you expect to see?
First:
map[A:B]
Second:
map[A:B C:D]
According to docs:
I expect unmarshal to reuse the existing map, instead of replacing it.
What did you see instead?
First:
map[A:B]
Second:
map[C:D]
The text was updated successfully, but these errors were encountered: