Home

Awesome

<h1 align="left">Go Installer 🐹 <a target="_blank" href="https://kounter.kerolloz.dev"> <img align="right" src="https://kounter.kerolloz.dev/badge/kerolloz.go-installer?style=for-the-badge&color=69d7e4&label=Views&labelColor=69d7e4" /> </a> </h1> <img align="right" src="https://user-images.githubusercontent.com/36763164/169433445-04f8485b-aa8d-45d0-a3cf-6e69c6456b2f.png" width="33%">

Install Golang on Linux or Mac <strike>with hassle of environment variables setting</strike>.

Contributions Welcome .github/workflows/test.yml

How to use it 🤔

Installing (or even updating) Go ⬇️

You can clone the repository and then run bash go.sh.

Or by simply running whatever suits you from the following commands (wget1 or curl):

# downloads then runs the script
wget https://git.io/go-installer.sh && bash go-installer.sh
# doesn't download the script ~ runs the script directly 
bash <(curl -sL https://git.io/go-installer)

Now, you can go grab a cup of coffee :coffee:, sit back :relieved: and relax while the magic happens! :crystal_ball:

Note
By default the script will create .go and go folders on your HOME directory & add the needed variables to your PATH variable.

$HOME/.go is where Go will be installed. $HOME/go is the default workspace.

In order to install Go to another location or set custom workspace. You can set environment variables GOROOT or GOPATH before installing (or uninstalling) Go.

For example:

export GOROOT=/opt/go            # where Go is installed
export GOPATH=$HOME/projects/go  # your workspace

Read more about workspaces in Go.

Specifying a version to install 🧐

By default, the script installs the latest version available.
You can choose what version to install by adding the --version flag, followed by the version you want to install.

bash go.sh --version 1.19.4

Show Help Message 🍁

To show the following help message use bash go.sh help.

<p align="center"> <img src="https://user-images.githubusercontent.com/36763164/207301551-c686e069-df78-4d28-af78-bedd02b36354.gif" /> </p>

Uninstalling Go ❌

bash go.sh remove

How it works ⚙️

The script does the following steps:

https://user-images.githubusercontent.com/36763164/207317882-7e50e2de-628e-43f0-bf7c-bee6b1e68001.mp4

<p align="center">🔥 WORKS LIKE A CHARM 🚀</p>

Footnotes

  1. the script depends on wget (1, 2)