Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Go


1. Go
GolangGo, or golang (to make it easier to locate on Internet searches, etc.) is a programming language developed by Google.

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. From the Go web site is at https://golang.org/ .

2. CentOS installation
As a newer language, the installation is somewhat more involved.

This installation will create some temporary files so go to you home directory and create a folder called INSTALL.GO.

The following Linux command(s) create a folder in which to install Go.
cd ~/ mkdir INSTALL.GO cd INSTALL.GO

The following Linux command(s) install go to /usr/local.
wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz tar -xzf go1.12.7.linux-amd64.tar.gz sudo mv go /usr/local

Note: You are not done. After verifying the version, set the proper environment (below).

3. Verify the version
The following Linux command(s) verify the installed version of go.
/usr/local/go/bin/go version

On 2019-08-04 the output was as follows.
go version go1.12.7 linux/amd64


4. Set the environment
Since this software was installed manually, some paths and environment settings need to be made to avoid specifying every path every time a command is used.

Type the following commands.

The following Linux command(s) set some go environment variables.
export GOROOT=/usr/local/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Since these paths are set, the following command can be used to verify the version of go.

The following Linux command(s) verify the installed version of go.
go version

This environment customization only works for the current session (i.e., until you logout, etc.). To have it set every time you login, add the above commands to the end of the file ~/bash_profile as follows.

The following Linux command(s) create/edit the file ~/bash_profile.
nano ~/bash_profile

Type the following into the editor at the end of the file to add settings to your bash profile.
export GOROOT=/usr/local/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

To exit with save, remember to press Ctrl-X, then "y" (for yes) and Enter to exit.

Now the paths are set for when you next login.

5. Hello world
The go language/system is project based and requires a folder that contains all files for that project.

... details to be added ...