Step 2 – Setting environment paths

The next step is to set some of the environment paths that Go needs. As our Go installation location is /usr/local, all of the steps provided are relative to that path.

First, you need to edit your .bashrc profile to tell Go where to look for its files:

$> sudo nano ~/.bashrc

Add the following lines at the end of the file:

export GOROOT=/usr/local/goexport PATH=$PATH:$GOROOT/bin

Save the file, and refresh your current session with the new $PATH value by running the following:

$> source ~/.bashrc

Now that you have installed Go and set the environment paths, you can test your installation to ensure that Go works properly simply by typing go version. It should yield the result go version go1.10.3 linux/amd64 ...

Get Blockchain across Oracle now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.