Rewrite of rig in Go.