An open source programming language built to craft simple, reliable, and efficient software.
To install Go compiler, type:
$ sudo dnf install go
go
and gofmt
binaries will become available on the system.
Go code lives in a workspace which is defined by GOPATH
environment variable. Upstream documentation uses $HOME/work
for your Go workspace:
$ mkdir -p $HOME/work
$ echo 'export GOPATH=$HOME/work' >> $HOME/.bashrc
$ source $HOME/.bashrc
Run go env
to check that $GOPATH
is set correctly:
$ go env | grep GOPATH
GOPATH="/home/$USER/work"