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 from the method to its caller (the array to which i append is part of the object which is used to invoke the method). 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 behavior expected? -- 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.