-
-
Save ndaidong/4c0e9fbae8d3729510b1c04eb42d2a80 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
export GO_VERSION=1.16.3 | |
export GO_DOWNLOAD_URL=https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz | |
export GOROOT=/opt/go | |
export GOPATH=$GOROOT/packages | |
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin | |
sudo mkdir $GOROOT | |
sudo chown -R ${USER} $GOROOT | |
if [ ! -f "go$GO_VERSION.linux-amd64.tar.gz" ]; then | |
wget "$GO_DOWNLOAD_URL" | |
fi | |
tar -zxvf go$GO_VERSION.linux-amd64.tar.gz | |
if [ -d "$GOROOT" ]; then | |
rm -rf ${GOROOT} | |
fi | |
mv go ${GOROOT} | |
echo "Installed Go v$GO_VERSION" | |
go version | |
# go get github.com/jesseduffield/lazydocker |
apt: invalid flag: upgrade
Usage: apt
where apt options include:
-classpath Specify where to find user class files and annotation processor factories
-cp Specify where to find user class files and annotation processor factories
-d Specify where to place processor and javac generated class files
-s Specify where to place processor generated source files
-source Provide source compatibility with specified release
-version Version information
-help Print a synopsis of standard options; use javac -help for more options
-X Print a synopsis of nonstandard options
-J Pass directly to the runtime system
-A[key[=value]] Options to pass to annotation processors
-nocompile Do not compile source files to class files
-print Print out textual representation of specified types
-factorypath Specify where to find annotation processor factories
-factory Name of AnnotationProcessorFactory to use; bypasses default discovery process
See javac -help for information on javac options.
....
go version
go version go1.6.2 linux/386
....
changed 1.10 in 1.10.1 on install script and apt-get .
thank you, just fixed and change to latest version 1.11.2
I tend to create 2 different partitions and mount as /workspace and /storage, my GOPATH is being set to /workspace in which I have all the source codes, projects, etc