The simple no fuss solution to your Go ambitions.
go-init:
- Provides option to select the version of go to be downloaded.
- Downloads appropriate go binary of your selected version for your platform from official google source.
- Extracts the binary and runs it,
- Setups $GOROOT and $GOPATH by entering required path variables into your zsh or bash shell automatically.
- Removes the downloaded .gz file and cleans things up.
- Remove past installations using the script.
It is written with an aim to fasten golang setup.
# wget or curl the script
$ wget https://raw.githubusercontent.com/solodynamo/go-init/master/goinit.sh
$ curl https://raw.githubusercontent.com/solodynamo/go-init/master/goinit.sh > goinit.sh
# Alternatively you can clone the repo and use it.
$ git clone [email protected]:solodynamo/go-init.git
# Do this
$ sudo chmod +x goinit.sh
- install go
./goinit.sh
- removes go
./goinit.sh -goaway
Path set for $GOROOT and $GOPATH
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/goworkspace
export PATH=$PATH:$GOPATH/bin
Always do :)
If you see a halt after running the script, type exit
and enter and keep doing this until things are done :)