Skip to content

dynnian/golang-tools-install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

go install script

This is a fork of the script made by canha at github.

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.

Supported shells:

  • Bash, fish, Zsh

๐Ÿ”จ Requirements

  • wget or curl
  • Bash shell

โฉ Install

Download and run with wget or curl.

wget -q -O - https://codeberg.org/dynnian/golang-tools-install/raw/branch/master/goinstall.sh | bash

# or...
curl https://codeberg.org/dynnian/golang-tools-install/raw/branch/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://codeberg.org/dynnian/golang-tools-install/raw/branch/master/goinstall.sh | bash -s -- --version 1.18

# or...
curl https://codeberg.org/dynnian/golang-tools-install/raw/branch/master/goinstall.sh | bash -s -- --version 1.18

๐Ÿšซ Uninstall

Pass the --remove option into the script:

wget -q -O - https://codeberg.org/dynnian/golang-tools-install/raw/branch/master/goinstall.sh | bash -s -- --remove

# or...
curl https://codeberg.org/dynnian/golang-tools-install/raw/branch/master/goinstall.sh | 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

Golang toolchain install script

Topics

Resources

License

Stars

Watchers

Forks

Languages