An example FSM implementation in Go