Skip to content

Instantly share code, notes, and snippets.

@josh-padnick
Last active August 29, 2015 14:22
Show Gist options
  • Save josh-padnick/944db615bdfaca7112c2 to your computer and use it in GitHub Desktop.
Save josh-padnick/944db615bdfaca7112c2 to your computer and use it in GitHub Desktop.
Install Latest Golang
#!/bin/bash
# Install goxc
go get github.com/laher/goxc
# May need to do these commands...
goxc -t
# Build the binaries
`GOOS=darwin GOARCH=386 go build -o /home/ubuntu/builds/ec2-snapper/0.1.0/darwin_386/ec2-snapper`
`GOOS=darwin GOARCH=amd64 go build -o /home/ubuntu/builds/ec2-snapper/0.1.0/darwin_amd64/ec2-snapper`
`GOOS=linux GOARCH=386 go build -o /home/ubuntu/builds/ec2-snapper/0.1.0/linux_386/ec2-snapper`
`GOOS=linux GOARCH=amd64 go build -o /home/ubuntu/builds/ec2-snapper/0.1.0/linux_amd64/ec2-snapper`
`GOOS=windows GOARCH=386 go build -o /home/ubuntu/builds/ec2-snapper/0.1.0/windows_386/ec2-snapper.exe`
`GOOS=windows GOARCH=amd64 go build -o /home/ubuntu/builds/ec2-snapper/0.1.0/windows_amd64/ec2-snapper.exe`
#!/bin/bash
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install gcc
sudo apt-get -y install git
git clone https://go.googlesource.com/go
mv go goroot
cd goroot
git checkout go1.4.2
cd src
./all.bash
mkdir /home/ubuntu/go
mkdir /home/ubuntu/goroot
# Add this to /home/ubuntu/.bash_profile
export GOPATH=/home/ubuntu/go
export PATH=/home/ubuntu/goroot/bin:$PATH
export PATH=$GOPATH/bin:$PATH
# Install dependencies
go get golang.org/x/tools/cmd/vet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment