<file_sep>#!/usr/bin/env bash

# download the latest version 
# I need verify if exists in directory currently exist version specific whatelse I need to download
# create variavle for resuse go version and go complete name
# wget -c https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz && \

# check the integrit
shasum -a 256 go1.11.1.linux-amd64.tar.gz && \

# remove go source if you have it
# I need to verify if exist go in this path, if exist remove that 
sudo rm -r /usr/local/go && \

# Extract archive and copy right path
sudo tar -C /usr/local -xvzf go1.11.1.linux-amd64.tar.gz

# create the above directory tree as follows
mkdir -p ~/go_projects/{bin,src,pkg} && \

# 
cd ~/go_projects

# show directory 
ls

# Add path environment variable
export PATH=$PATH:/usr/local/go/bin && \

# set values
export GOPATH="$HOME/go_projects" && \
export GOBIN="$GOPATH/bin" && \

# If I installed GoLang in a custom directory I need specify that directory as value of GOROOT variable.
# export GOROOT=$HOME/go && \
# export PATH=$PATH:$GOROOT/bin && \

# changes made to the user profile in the current bash session
source ~/.profile
# or 
# source ~/.bash_profile

# verify Golang Installation
go version
go env
# https://www.tecmint.com/install-go-in-linux/