Go Installation: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 33: Line 33:
=Post-Installation=
=Post-Installation=
<font color=darkkhaki>
<font color=darkkhaki>
Set <code>[[Go_Runtime#GOPATH|GOPATH]]</code> to match your local environment.
Set <code>[[Go Development and Execution Environment#GOPATH|GOPATH]]</code> to match your local environment.
</font>
</font>

Revision as of 00:59, 15 August 2023

Internal

Installation

Mac

https://go.dev → Download → Apple macOS (ARM64) or Apple macOS (x86-64) → .pkg → double-click.

It installs in usr/local/go.

Linux

https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz

Install under /opt:

cd /opt
wget https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
gunzip < go1.6.linux-amd64.tar.gz | tar xfv -
mv go go1.6
ln -s ./go1.6 go

Then update .bashrc, declare GOROOT environment variable:

export GOROOT=/opt/go
export PATH=...:${GOROOT}/bin:...

Post-Installation

Set GOPATH to match your local environment.