Golang setups in Windows and Unix enviroments
Setup Golang is not that hard. To install golang your can go to golang downloads .
Windows
If you are going to install on windows you can download windows binaries of 32/64 architects
if you are planning to download the compressed files, you have to set path variables in system environment.
or you can install the installer with msi version, which will install and do all the necessary settings for you.
you can also work with Linux environment using Windows Subsystem for Linux (WSL) .
Windows has provided good article for installing WSL in your machine wsl installtion
Linux
Go binary distributions are available for these supported operating systems and architectures. Please ensure your system meets these requirements before proceeding. If your OS or architecture is not on the list, you may be able to install from source or use gccgo instead.
Download the archive and extract it into /usr/local, creating a Go tree in /usr/local/go. For example:
|
|
Setup Go Environment
Add this to your ~/.bashrc file
GOROOT is the location where Go package is installed on your system.
|
|
GOPATH is the location of your work directory. For example my project directory is ~/go, you can create what ever folder structure you want.
|
|
Sytem wide PATH setting
|
|
If you want to install to any specific Linux distribution, lets say Fedora.
you can install with the command
|
|
this will install latest stable version in your system.
To check the go version installed in your system
|
|
this will show the go version in your terminal
Get all go evironment variable settings.
|
|