The objective of this guide is to install Go/Golang on Ubuntu 20.04 Focal Fossa Linux. Go also know as Golang, is an open source programming language developed by Google.
In this tutorial you will learn:
- How to install Go / Golang
- How to download example hello world application
- How to run example hello world application
Software Requirements and Conventions Used
|Category||Requirements, Conventions or Software Version Used|
|System||Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How To Install Go on Ubuntu 20.04 step by step instructions
- From a terminal execute the following command to install Go language executables:
$ sudo apt install golang
- Confirm the installation by checking for the
$ go version
- Download Golang hello world example:
$ go get github.com/golang/example/hello
After execution of the above command a new directory named
gowill be created in your user home directory containing a source code and executable binary of the Hello World Golang program.
Given that the new
godirectory is located within you user home directory, to execute the
$ ~/go/bin/hello Hello, Go examples!