Update 26th July 2019 (for go >=1.11)
go run .
Will work on windows as well.
Original answer (for non windows environments)
The code actually works. The problem was that instead of running go run main.go I should run:
go run *.go
go run .
Will work on windows as well.
The code actually works. The problem was that instead of running go run main.go I should run:
go run *.go