To install Go (Golang) on Windows, follow these steps:
Download Go: Go to the official Go website at https://golang.org/dl/ and download the latest stable version of Go for Windows. Choose the installer that matches your operating system (32-bit or 64-bit).
Run the Installer: Once the download is complete, run the downloaded installer. The installer will guide you through the installation process.
Choose Installation Location: During the installation, you’ll be asked to choose an installation location for Go. The default location is usually fine, but you can choose a different location if you prefer.
Set Environment Variables: After the installation is complete, you need to set the Go-specific environment variables to use Go from the command prompt.
Open the Start menu and search for “Environment Variables.”
Click on “Edit the system environment variables” to open the System Properties window.
Click the “Environment Variables” button at the bottom of the window.
Under “System variables,” click “New” to add a new environment variable.
For the “Variable name,” enter GOROOT.
For the “Variable value,” enter the path where Go is installed. For example, C:\Go (if you installed it in the default location). Next, add the Go binary path to the PATH environment variable:
Find the “Path” variable under “System variables” and click “Edit.”
Click “New” and add the path to the Go bin directory. By default, it is C:\Go\bin. If you installed Go in a different location, use that path.
Verify Installation: Open a new command prompt window and type go version. If everything is set up correctly, it should display the installed Go version.
To install Go (Golang) on a Linux system, you can use the following steps: