Skip to content

Instantly share code, notes, and snippets.

@jeremyje
Last active January 15, 2024 08:07
Show Gist options
  • Select an option

  • Save jeremyje/6b4cb25cdfe6fe09e13d441428e63c59 to your computer and use it in GitHub Desktop.

Select an option

Save jeremyje/6b4cb25cdfe6fe09e13d441428e63c59 to your computer and use it in GitHub Desktop.
#!/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
@Amirkoutavi
Copy link

چطور میتوانم یک سرور رایگان v2ray بسازم

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment