capric98 / golang-tools-install-script

Simple Bash script to automate Go language tools single user installation or even removal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

golang-tools-install-script Build Status

Bash script to automate installation and removal of single user Go language tools.

Feel free to change the variables on the beginning to match whatever version of Go you need.

Tested working on:

  • βœ… Ubuntu 16.04 to 18.04
  • βœ… macOS Sierra (10.12) to Catalina (10.15)

Supported shells:

  • Bash, fish, Zsh

πŸ”¨ Requirements

  • wget or curl
  • Bash shell

⏩ Install

Download and run with wget or curl. Here's the short version using the official git.io shortening:

# Linux typically has wget installed
wget -q -O - https://git.io/vQhTU | bash

# macOS typically has curl installed
curl -L https://git.io/vQhTU | bash

Or, if you are more comfortable with the raw URL:

wget -q -O - https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh | bash

# or...
curl https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh | bash

πŸ“¦ Install a custom Go version

Pass the --version option into the script including the version that you wish to install.

Example:
wget -q -O - https://git.io/vQhTU | bash -s -- --version 1.13.2

# or...
curl -L https://git.io/vQhTU | bash -s -- --version 1.13.2

🚫 Uninstall

Pass the --remove option into the script:

wget -q -O - https://git.io/vQhTU | bash -s -- --remove

# or...
curl -L https://git.io/vQhTU | bash -s -- --remove

πŸ“ Notes

By default, the script will create .go and go folders on your home directory and add the needed variables and PATH expansion.

$HOME/.go is the directory where Go will be installed to.

$HOME/go is the default workspace directory.

Read more about the workspace.

In order to install Go into another location, set the environment variables $GOROOT and $GOPATH before (un)installing:

export GOROOT=/opt/go
export GOPATH=$HOME/projects/go

About

Simple Bash script to automate Go language tools single user installation or even removal.

License:Apache License 2.0


Languages

Language:Shell 96.5%Language:Python 3.5%