install-go.sh 648 B

1234567891011121314151617181920212223
  1. #/bin/bash
  2. echo "Input the go arch to install (arm/arm64/amd64)"
  3. read -p "Architecture: " arch
  4. if [ "$arch" = "arm" ]; then
  5. echo "Installing arm version of go"
  6. wget https://golang.org/dl/go1.15.3.linux-armv6l.tar.gz
  7. fi
  8. if [ "$arch" = "arm64" ]; then
  9. echo "Installing arm64 version of go"
  10. wget https://golang.org/dl/go1.15.3.linux-arm64.tar.gz
  11. fi
  12. if [ "$arch" = "amd64" ]; then
  13. echo "Installing amd64 version of go"
  14. wget https://golang.org/dl/go1.15.3.linux-amd64.tar.gz
  15. fi
  16. sudo tar -C /usr/local -xzf go*
  17. echo "ADD THE FOLLOWING LINE TO YOUR ~/.bashrc FILE:"
  18. echo 'export PATH=$PATH:/usr/local/go/bin'
  19. echo "Install Complted"