go¶
Install¶
Figure out how to deal with armv6l
and armv7l
.
(
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(armhf\)\(64\)\?.*/\1\2hf/' -e 's/aarch64$/arm64/')" && \
VERSION="$(curl https://go.dev/VERSION?m=text)" && \
wget "https://dl.google.com/go/${VERSION}.linux-${ARCH}.tar.gz" -O- | sudo tar -C /usr/local -xzf -
)
# ~/.bash_exports
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go/
Clear the build cache¶
$ go clean -cache -modcache -i -r
Get go version¶
$ GO_VERSION=$(curl -sSL "https://go.dev/VERSION?m=text")
Init¶
go mod init project-name
go mod tidy
go run ./...