This is more a note to myself and a very short guide (without any comments or explaination) how to install golang on a Raspberry PI. Maybe it’s useful for somebody else, too.
Install Go
- Visit https://golang.org/dl/
- Find download URL of latest stable version for Linux ARM V6 (at the time of this post it was go1.12.7.linux-armv6l.tar.gz)
- Login to Raspberry pi with SSH
wget https://dl.google.com/go/go1.12.7.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.12.7.linux-armv6l.tar.gz
- Add the following line to ~/.profile:
export PATH=$PATH:/usr/local/go/bin
source ~/.profile
(or just log out and in again)go version
go version go1.12.7 linux/arm
Setting Go-Path
- Add the following 2 lines to ~/.profile (Change path if needed):
export GOPATH=$HOME/workspace/go
export PATH=$PATH:$GOPATH/bin
That’s it.
If you know a better way to install it, just leave a comment.