Use array of children for each node This vastly simplifies the code and makes it easy to add more children per node if that becomes useful.
Persistent data structures for Go. See the full package documentation
Install with
go get github.com/mndrix/ps