This gist contains the cat Unix command—written in Go.
The following Go program concatenates files passed as command-line arguments. If you don't pass any command-line arguments, then cat reads from stdin (it's the cat Unix utility).
The following procedure shows how to build and run cat.