How To Set The Go Programming Environment On Your System?(Learn 'Go' - Part 3)

in #programming6 years ago (edited)

The process to install 'Go' on your system is straightforward and easy. You will need the basic knowledge of the Terminal. Don't worry! The steps are easy to follow.

 
 

Steps To Install 'Go' On A Windows Computer

 

Step 1. First of all, you need to create a workspace for your Go projects. For instance, 'C:\Projects\Go'.

Step 2. Download and install the latest 'Go' set for Windows here.

Step 3. Follow the instructions and install the Go Distribution on your system.

Step 4. Open the 'Command Prompt' by searching 'cmd' and type go version in the command prompt.

Step 5. You should be able to see the installed version on the command prompt. goVersion.JPG

Step 6. After installing the Go, you will need to create a workspace. Open the 'Control Panel' and go to 'System & Security'.

Step 7. Open 'System' and click the 'Advanced System Settings'.

Step 8. Open the 'Advanced' tab and click the 'Environmental Variables'.

Step 9. Make sure that the path under 'System Variables' is set to 'C:\Go\bin'.

Step 10. Create your workspace in a separate folder. For instance, 'C:\Projects\Go'. Create three separate folders in the directory, bin, pkg & src.

Step 11. Now you will have to set your GOPATH variable and set a reference to your workspace.

Step 12. Navigate to 'Environmental Variables' again. Under 'System Variables', click 'New'.

Step 13. Set the 'Variable name' to 'GOPATH' & 'Variable value' to the path of your workspace folder. For instance, 'C:\Projects\Go'.

Environmental Variable.JPG

Step 14. Make sure that the path has been set correctly on the Command Prompt. Type echo%GOPATH% on the Command Prompt.

 
 
 

There is an alternate way to install 'Go' on your system, i.e., by using the MSI installer. You can download the MSI installer here. It will make your work easier. Just check the installation by running the command go version in the command prompt.

 
 
 

Steps To Install Go On A Mac Computer

 

Step 1. Remove any old installation if you had any. Open terminal and type sudo rm -rfv /usr/local/go.

Step 2. You can download the installation package for the 'Mac OS' here.

Step 3. Just follow the instructions and you're done. The default location for the workspace will be set to '$HOME/go'.

 
 
 

You can find the installer package for Linux on the same link.

 
 

Now, you are ready to dive into programming with 'Go'. In the next part, you will create your first program.

 
 


 

In Part 2, you got familiar with the 25 basic keywords of 'Go'.

 
 


 

In Part 4, you will 'Create Your First Program In Go Programming Language.'

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 60787.40
ETH 2994.79
USDT 1.00
SBD 3.82