go

go

TLDR

Download and install a package, specified by its import path

>_ go get [package_path]
copy

Compile and run a source file (it has to contain a main package)

>_ go run [file].go
copy

Compile a source file into a named executable

>_ go build -o [executable] [file].go
copy

Compile the package present in the current directory

>_ go build
copy

Execute all test cases of the current package (files have to end with _test.go)

>_ go test
copy

Compile and install the current package

>_ go install
copy

Initialize a new module in the current directory

>_ go mod init [module_name]
copy

Copied to clipboard
free 100$ digital ocean credit