12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #!/usr/bin/env bash
- go_tar_gz="go1.12.linux-amd64.tar.gz"
- go_url="https://dl.google.com/go/${go_tar_gz}"
- wget --no-check-certificate -O ${go_tar_gz} ${go_url}
- tar -xvf ${go_tar_gz}
- rm ${go_tar_gz}
- cat <<EOF >> ~/.profile
- export GOROOT=/root/go
- export GOPATH=/root/go/work
- export PATH=$PATH:/root/go/bin
- EOF
- source ~/.profile
- mkdir -p /root/go/work
- mkdir -p ~/helloworld
- cd ~/helloworld
- cat <<EOF >> helloworld.go
- // Test that we can do page 1 of the C book.
- package main
- func main() {
- print("hello, world\n")
- }
- EOF
- go build
- ./helloworld
|