Structs and maps, https://play.golang.org/p/u8iLBDDm2YP


(Cherolyn Lexvold) #1

https://play.golang.org/p/u8iLBDDm2YP

Why dos this code show the results only for person 2, and not person 1?


(Cherolyn Lexvold) #2

*does


(Norbert Melzer) #3

As both entries have the same key ("Jones") the last inserted items overwrites the previous ones.


(Cherolyn Lexvold) #4

Interesting. I’ll try changing that.


(Cherolyn Lexvold) #5

https://play.golang.org/p/bing6SA8iCG

Success!