Skip to main content

Go CLI (Command Line Interface)

🌐 pkg.go.dev/cmd/go, docs

Usual commands

CommandAction
go versionDisplays version
go run .Executes the code
go buildCompiles a code (creates an executable binary)
go mod init <domain>/<app>Creates go.mod file
go install <domain>/<pkg>Builds and installs the program with the go tool (in $HOME/go/bin/hello or %USERPROFILE%\go\bin\hello.exe)