encoding/json: Unmarshal into *interface{} that contains specific value #6640
Labels
Comments
Indeed, but that was just a simplified example demonstrating the behavior. Here are similar examples: http://play.golang.org/p/nhpFM4roxD and http://play.golang.org/p/PDwJF7Kcxj |
The issue is that the concrete value of the interface{} value is just a value, and is not addressable, and so the JSON package can't modify it. Change the line a := &A{B: B{}} to a := &A{B: &B{}} and you'll see that it works. Here is a reduced example that demonstrates the difference: http://play.golang.org/p/AyC8gSZh-d Status changed to WorkingAsIntended. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by Lytvynov.A.V:
The text was updated successfully, but these errors were encountered: