We have recently been working on a game called hackerbots whose server-side component we chose to author in go. We learned quite a few lessons about how to write server-side code in go along the way. A few of the things we will discuss include:
- how to test for (and solve) leaking go routines
- how to use the profiler to uncover issues with your code
- mixing websockets and http for game play and game control
- go concepts that help us separate game state, player updates, and network traffic
- optimizing JSON serialization for minimal traffic while maintaining human readability
- how go got in our way, and what we did to make it less painful