I have a list of users and I am finding a hard time to understand which approach is better and faster for the purpose of nesting array struct of users inside another struct.
For an example - type loc struct { Type string Point []float64 } type User struct { ID string Name string Location loc } *Case A* - Using pointer for nested array struct type Games struct { ID string Owner []*User Player []*User } // and storing it as G:= Games{ ID: "1", Owner: []*User{ &User { ID: "2", Name: "R sharma", }, }, } *Case B* - Should I use above approach or below approach to type Games struct { ID string Owner []User Player []User } // storing it as G := Games { ID: "1", Owner: []User{ { ID: "2", Name: "R Sharma", }, }, } *Considering the situation, I do not have to change data for Owner or Player after creating value for Games above and Player can sometimes remain Nil, should I use only User or it's better to use *User* I have following confusion based on above 2 cases 1. Performance - which one is better & why? 2. Garbage Collection - which one is better & why? 3. Any Memory effects? 4. Any other effects! *Please help me out understanding*, which method would you have chosen above and why? -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.