▲ 7 ▼ Video: Flappy Gopher III - Collision detection
The final episode of the Flappy Gopher trilogy! We'll cover how to detect collision between the bird and the pipes. Get ready from some mutual exclusion action!
Register to comment or vote on this story
Really nice to see some examples of building everyday software with Go. I really like this video series and that he's trying to focus on real world use of Go in areas where you don't traditionally see it used. According to his twitter the next post will be on something completely different - using the new context package.
Something I noticed watching this video is that Francesc adds a lock to his struct by including it as a field named
mu
. My practice is typically to add a mutex to my struct as an embedded (unnamed) type. Stylistically, I wonder, is there a reason to prefer one way to the other?I wondered that too. It is perhaps more obvious exactly what you're doing, esp for a tutorial, otherwise it might not be obvious what lock does for those following along.