Examples (4)
Compile a 'package main' file (output will be the filename without extension)
go build path/to/main.goCompile, specifying the output filename
go build -o path/to/binary path/to/source.goCompile a package
go build -o path/to/binary path/to/packageCompile a main package into an executable, enabling data race detection
go build -race -o path/to/executable path/to/main_packagemade by @shridhargupta | data from tldr-pages