Re: [go-nuts] Map inside a struct

2019-04-30 Thread Jan Mercl
On Tue, Apr 30, 2019 at 4:31 PM wrote: > In the method, I can debug and see that the struct got created with map and > its key value pair, however when the method returns to the caller, the struct > is there PI and cat initialised, but the key value pairs disappear from the > map. Is this beha

[go-nuts] Map inside a struct

2019-04-30 Thread mdmajid . jahangir
I have a map inside a struct like following - type DP struct { PI string cat map[string]PS } Here, PS is another struct having two string fields. There is method where I create DP struct, initialise the map and put a key-value pair to it. I append this DP struct to an array and return fr