A Go solution without global variables.