top of page

How To Automate Go language Installation

In this blog, we are going to Automate Go-Lang Installation using Bash Scripting.


Go-Lang is one of the most important programming languages because many web application CLI tools are run on Go-Lang.

we can use those tools to automate our testing which we will discuss in another blog.

Script:


#!/bin/bashif [[ $(id -u) != 0 ]]; then
    echo -e "\n[!] Requires root privileges"
    exit 0
fi
echo "updating!"
apt update && sudo apt full-upgrade -yecho "Downloading Go language!"
wget https://go.dev/dl/go1.17.6.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.17.6.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
echo "export GOPATH=~/.go" >> ~/.profile
source ~/.profile
go version
echo "Go language Installed!"

7 views0 comments
bottom of page