Configuring Go

Go is now installed, but in order to use the tools, we must ensure that it is properly configured. To make calling the tools easier, we need to add our go/bin path to the PATH environment variable.

Note

On Unix systems, you should add export PATH=$PATH:/opt/go/bin (make sure it is the path you chose when installing Go) to your .bashrc file.

On Windows, open System Properties (try right-clicking on My Computer), and under Advanced, click on the Environment Variables button and use the UI to ensure that the PATH variable contains the path to your go/bin folder.

In a terminal (you may need to restart it for your changes to take effect), you can make sure this worked by printing the value of the PATH variable:

echo $PATH

Ensure that the ...

Get Go Programming Blueprints - Second Edition 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.