Try http://golang.org/pkg/encoding/binary/#PutUvarint?