Last active
January 15, 2024 08:07
-
-
Save jeremyje/6b4cb25cdfe6fe09e13d441428e63c59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # curl https://gist.githubusercontent.com/jeremyje/6b4cb25cdfe6fe09e13d441428e63c59/raw/install-go.sh | bash | |
| # https://golang.org/dl/ | |
| LATEST_GO_VERSION=1.13.1 | |
| PrepareInstallation() { | |
| mkdir -p packages | |
| cd packages | |
| sudo apt-get -qq -y update | |
| sudo apt-get -qq -y install cmake build-essential git autoconf automake \ | |
| libtool curl build-essential | |
| } | |
| Cleanup() { | |
| rm -rf packages/ | |
| } | |
| InstallGolang () { | |
| export GOPATH_PRIMARY=${HOME}/golibs | |
| GO_PACKAGE=go${LATEST_GO_VERSION}.linux-amd64.tar.gz | |
| mkdir -p ${GOPATH_PRIMARY} | |
| sudo rm -rf /usr/local/go/ | |
| curl https://storage.googleapis.com/golang/${GO_PACKAGE} | sudo tar -C /usr/local -xz | |
| sudo sh -c "echo 'export PATH=/usr/local/go/bin:${GOPATH_PRIMARY}:$PATH' >> /etc/profile" | |
| sudo sh -c "echo 'export GOROOT=/usr/local/go' >> /etc/profile" | |
| export PATH=/usr/local/go/bin:${GOPATH_PRIMARY}:$PATH | |
| export GOROOT=/usr/local/go | |
| } | |
| Main() { | |
| PrepareInstallation | |
| InstallGolang | |
| Cleanup | |
| } | |
| Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
چطور میتوانم یک سرور رایگان v2ray بسازم