Recently implemented A* Path finding algo using Go as a way to learn Go. Couldn't help myself and went ahead and added a UI layer on top of it using a 2d game library called Ebiten.
Very fun little project! Got a hairy bug, which took me about 1-2 hours to figure out, which involved not realising that when I created a struct and added it to a slice, it was not the same struct as I had just created, in terms of memory address!
Very fun little project! Got a hairy bug, which took me about 1-2 hours to figure out, which involved not realising that when I created a struct and added it to a slice, it was not the same struct as I had just created, in terms of memory address!
So in pseudo code:
myThing := struct{attributes...} mySlice[0] := myThing sameThing := mySlice[0] &sameThing == &myThing False
Definitely know Go a lot better now. Looking forward to doing some others on this list.