go run

The go subcommand that compiles a program to a temporary place and runs it straight away, leaving no binary behind.

In more detail

go run is for the edit-and-check loop while you are writing code. Words after the package are passed to your program as arguments, not to the compiler. Use go build when you need a file to ship.

Examples

go run .
go run . more arguments  # extra words reach os.Args

Related terms

Taught in

References