How To Install Go in Linux
Download packages for Windows 64-bit, macOS, Linux, and more.
Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extract the archive you just downloaded into /usr/local, creating a fresh Go tree in /usr/local/go:
Add /usr/local/go/bin to the PATH environment variable. You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):
#sudo vi /etc/.profile #source /etc/.profile export PATH=$PATH:/usr/local/go/bin
go version go1.18.1 linux/amd64
Open the package file you downloaded and follow the prompts to install Go. The package installs the Go distribution to /usr/local/go. The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.
Open the MSI file you downloaded and follow the prompts to install Go.
Installing Go from source
Most users don't need to do this, and will instead install from precompiled binary packages as described in Download and install. See: Installing Go from source
Try Go Online
You can try Go online in the Go Playground without installing anything on your computer. See: TRY GO WITHOUT INSTALLING
Go Help Commands and Options
Go is a tool for managing Go source code.
The commands are:bugstart a bug reportbuildcompile packages and dependenciescleanremove object files and cached filesdocshow documentation for package or symbolenvprint Go environment informationfixupdate packages to use new APIsfmtgofmt (reformat) package sourcesgenerategenerate Go files by processing sourcegetadd dependencies to current module and install theminstallcompile and install packages and dependencieslistlist packages or modulesmodmodule maintenanceruncompile and run Go programtesttest packagestoolrun specified go toolversionprint Go versionUse "go help <command>" for more information about a command. Additional help topics:vetreport likely mistakes in packagesbuildconstraintbuild constraintsbuildmodebuild modesccalling between Go and Ccachebuild and test cachingenvironmentenvironment variablesfiletypefile typesgo.modthe go.mod filegopathGOPATH environment variablegopath-getlegacy GOPATH go getgoproxymodule proxy protocolimportpathimport path syntaxmodulesmodules, module versions, and moremodule-getmodule-aware go getmodule-authmodule authentication using go.sumpackagespackage lists and patternsprivateconfiguration for downloading non-public codetestflagtesting flagstestfunctesting functionsUse "go help <topic>" for more information about that topic.vcscontrolling version control with GOVCS