(Loosely) follows the A Cloud Guru course by Keith Thompson.
- Set env vars in
~/.bashrc
# PATH
export GOPATH="${HOME}/go"
export GOROOT="${HOME}/.go"
export PATH="$GOPATH/bin:$PATH"
# go
# https://stackoverflow.com/a/67930263
export GO111MODULE=auto- Install
gthen select latest go version
curl -sSL https://git.io/g-install | sh -sVia Digital Ocean
# Run with temp binary
$ go run hello.go
Hello, World!
# Compile for realsies
$ go build -o hello
$ ./hello
Hello, World!
# Move to compiled directory
$ mv hello ../bin