You can try one of the following:
Method 1:
MyProject
go build
./MyProject
You can do both steps at once by typing go build && ./MyProject
. Go files of the package main
are compiled to an executable.
Method 2:
go run *.go
. It won't create any executable but it runs.