How can I “go run” a project with multiple files in the main package?

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

Leave a Comment