The go run
command compiles and runs a main package comprised of the .go files specified on the command line. The command is compiled to a temporary folder.
The go build
and go install
examine the files in the directory to determine which .go files are included in the main package.