golang install

Download the latest version of Go.

bash
1
2
wget https://dl.google.com/go/go1.22.4.linux-amd64.tar.gz 
sudo tar -C /opt -xzf go1.22.4.linux-amd64.tar.gz
nano ~/.bashrc
bash
1
export PATH=$PATH:/opt/go/bin
source ~/.bashrc

Authenticate to github by editing ~/.netrc file.

bash
1
machine github.com login $(user) password $(token)

Add to known hosts to avoid firewall issues.

bash
1
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

Define organisation repositories as private modules.

bash
1
go env -w GOPRIVATE=github.com/alpha-omega-corp/*