Go Tutorial Part 2 - Go CLI
Contents
Go provides a handful of commands apart from the standard build
and run
to make our life easier.
1 Run
go run filename
Builds the files and runs them instantly
2 Build
go build filename
Builds the files but does not run them. The executables can be seen in te same directory
3 Format
go fmt
Formats all the files in the directory
4 Install
go install packagename
Compiles and Installs a package
5 Get
go get
Downloads raw source code of a package
6 Test
go test
Runs all tests for the project