Install Golang on a Raspberry Pi

Get the latest version from https://golang.org/dl/ then download the arm based archive:

$ wget https://dl.google.com/go/go1.13.7.linux-armv6l.tar.gz

Then extract to path:

$ sudo tar -C /usr/local -xzf go1.13.7.linux-armv6l.tar.gz

Set your PATH variable:

$ export PATH=$PATH:/usr/local/go/bin

And also set it to the /etc/profile.d/ directory so that its persisted after logins:

$ sudo -H -u root bash -c "echo 'export PATH=\$PATH:/usr/local/go/bin' > /etc/profile.d/golang.sh"

Verify that go is working:

$ go version
go version go1.13.7 linux/arm  

Remove the archive:

$ rm -rf go1.13.7.linux-armv6l.tar.gz