Giter Site home page Giter Site logo

canha / golang-tools-install-script Goto Github PK

View Code? Open in Web Editor NEW
528.0 11.0 138.0 103 KB

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

License: Apache License 2.0

Shell 100.00%
shell linux macos bash installer golang fish-shell

golang-tools-install-script's Introduction

golang-tools-install-script

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 20.04
  • โœ… macOS Sierra (10.12) to Big Sur (11.3)

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.18

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

๐Ÿšซ 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.