Skip to content
๐Ÿ“œ A simple shell script to install the Go ๐Ÿ’™ programming language!
Shell
Branch: master
Clone or download
Fetching latest commitโ€ฆ
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE.md
README.md
_config.yml
go.sh

README.md

Go Installer ๐Ÿน


Install Golang on Linux or Mac with hassle of environment variables setting.

How to use it ๐Ÿค”

Installing(or updating) Go โฌ‡๏ธ

You can clone the repository or just use wget to download the script

wget https://raw.githubusercontent.com/kerolloz/go-installer/master/go.sh
bash go.sh

Now, You can go grab a cup of coffee โ˜•๏ธ, set back ๐Ÿ˜Œ and watch the magic happen! ๐Ÿ”ฎ

Please Note that

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 location where Go will be installed to.
$HOME/go is the default workspace.

In order to install Go to other 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.

Uninstalling Go โŒ

bash go.sh remove

How it works ๐Ÿ”ฅ

The script does the following steps:

  • checks if you have already installed Go!
  • automatically checks the installed operating system (Linux or Mac)
  • detects system architecture (armv6, armv8, amd64, i386)
  • parses the golang download page to find the latest version of Go that is available for your platform and architecture
  • in case of having already installed Go, if the latest and the current version are equal, the script exits ๐Ÿ‘‹
  • downloads the latest version
  • creates needed folders for workspace and Go binaries
  • extracts the files of the downloaded package
  • adds the binaries to PATH environmental variable

WORKS LIKE A CHARM ๐Ÿš€

Tests

Tested by Travis โœ”๏ธ on:

  • Linux ๐Ÿง
  • Mac ๐Ÿ’ป

Tested manually on:

  • Ubuntu
  • Manjaro

License

MIT License

You canโ€™t perform that action at this time.