Install Golang in Arch Linux

·
1 min read
notes
#arch #golang

How to install Golang in Arch Linux

Golang doesn’t have its own installer, so we can just install it with pacman.

Terminal window
sudo pacman -S go

I like my Golang workspace in FHS style. The default is in $HOME/go.

Terminal window
mkdir ~/.local/share/go
go env -w GOPATH=$HOME/.local/share/go

Add to PATH, edit ~/.bashrc:

Terminal window
export PATH=$PATH:$(go env GOPATH)/bin