How to write to a map with the value of type slice of pointer to a struct

https://play.golang.org/p/HY0p2IljmQn
Made a map with key of type string, and value of type []*Struct.
Not sure how to write to it, and then work with it.

1 Like
  1. You need to wrap the inner Persons in &Person{} as well
  2. You need to name the Likes field in the inner Person

https://play.golang.org/p/-tAoV0hGZDp

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.