Install Golang in Linux

Procedure to install Golang with one script from specific version (based on https://go.dev/doc/install).

1
2
3
4
5
6
7
8
#!/bin/bash
VERSION=1.21.4

cd /tmp
curl -LO "https://go.dev/dl/go${VERSION}.linux-amd64.tar.gz"
rm -rf /usr/local/go && tar -C /usr/local -xzf "go${VERSION}.linux-amd64.tar.gz"
export PATH=$PATH:/usr/local/go/bin
go version