Skip to content

go

golang install latest version

apt install -y git wget curl jq
GOVER=$(curl --silent https://go.dev/dl/?mode=json | jq -r '.[0].version')
curl -LO --silent go.dev/dl/${GOVER}.linux-amd64.tar.gz
tar -C /usr/local -xzf ${GOVER}.linux-amd64.tar.gz
rm ${GOVER}.linux-amd64.tar.gz
ln -s /usr/local/go/bin/go /usr/local/bin/go

golang build static binary

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build