I am trying to use structure (which contains pointers ) as key in map , I want to map based on the values of structure but, I am not getting expected results.
here is sample code
https://play.golang.org/p/NGuvq40aHl8
please help me…
I am trying to use structure (which contains pointers ) as key in map , I want to map based on the values of structure but, I am not getting expected results.
here is sample code
https://play.golang.org/p/NGuvq40aHl8
please help me…
Well your ro
is a pointer so it will have different adress on each iteration.
Is there any way to get expected result
Thanks ,
Actually I made simple change i.e I concatenated all the values of struct fields as string and used this string as a key.I got expected results.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.