saner php bounds
1:1 translation of php example to Go
optimize a little
add a more idiomatic Go version
Merge pull request #2 from zimmski/go-version

Go version