Go Commands
go run
The command for executing a go program.
Example: To run the main.go
file, execute the command below:
go run main.go
go build
To build the code to an executable and distributable program.
Example: To build the project with main.go
as an entry point, execute the command below:
go build main.go
To run the executable file, run the following command:
./main
gofmt
Formats the codes in the current directory into GoLang's standard code format.
Example: To format the code, execute the following command:
gofmt