Create main.go

Go implementation using a closure and no global state.