Golang Installation / Ubuntu 18.04 Environment
1. Installation Environment
The installation environment is as follows:
- Ubuntu 18.04 LTS 64bit, root user
- golang 1.12.2
2. Ubuntu Package Installation
$ wget https://dl.google.com/go/go1.12.2.linux-amd64.tar.gz
$ tar -xvf go1.12.2.linux-amd64.tar.gz
$ mv go /usr/local
Install golang. Install in /usr/local/go directory.
3. Environment Variable Configuration
|
|
Configure environment variables for golang in ~/.bashrc file and make golang available from any directory.
- GOROOT : Directory containing golang commands, packages, libraries, etc.
- GOPATH : Home directory of the golang program currently being developed.
- GOBIN : Directory where compiled golang binaries are copied when using go install command.