structA is an interface{}. Before unmarshal, it is pointing to a
StructA value. Unmarshal, seeing that the argument is an interface{},
unmarshals the JSON into a map[string]interface{}, and points structA
to it.
If you do:
structA := slice["struct-a"].(StructA)
structA will becoma a StructA type variable, and will do what you expect.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-nuts...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.