Skip to content

Instantly share code, notes, and snippets.

@bradw2k
Forked from einthusan/go1.4arc65-ubuntu.sh
Last active July 19, 2023 04:18
Show Gist options
  • Save bradw2k/e776d26df44f59adfe44 to your computer and use it in GitHub Desktop.
Save bradw2k/e776d26df44f59adfe44 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Install Golang 1.4 on Amazon Linux
echo "install correct language pack"
cat <<EOF > /etc/default/locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
EOF
. /etc/default/locale
echo "install Mercurial"
yum install mercurial -y
echo "download Go and install it, as well as create GOPATH directory"
cd ~
wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
tar -xf go1.4.2.linux-amd64.tar.gz && rm go1.4.2.linux-amd64.tar.gz
mv go /usr/local && mkdir -p /usr/local/gopath
echo "set enviornment variables required for Go"
export GOROOT=/usr/local/go
export GOPATH=/usr/local/gopath
cat <<EOF >> /etc/profile.d/dev-env.sh
export GOROOT=/usr/local/go
export GOPATH=/usr/local/gopath
export "PATH=/usr/local/gopath/bin:/usr/local/go/bin:/opt/rubies/ruby-2.1.4/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin:/opt:$PATH"
export GORACE=log_path=/usr/local/gopath/racereport
export w=/usr/local/gopath/src/github.com
EOF
. /etc/profile.d/dev-env.sh
# install Go tools
echo "installing go tool ... golint"
go get github.com/golang/lint/golint
echo "installing go tool ... errcheck"
go get github.com/kisielk/errcheck
echo "installing go tool ... benchcmp"
go get golang.org/x/tools/cmd/benchcmp
echo "installing go tool ... impl"
go get github.com/josharian/impl
echo "installing go tool ... goimports"
go get golang.org/x/tools/cmd/goimports
echo "installing go tool ... goreturns"
go get sourcegraph.com/sqs/goreturns
echo "installing go tool ... godef"
go get code.google.com/p/rog-go/exp/cmd/godef
echo "installing go tool ... gocode"
go get github.com/nsf/gocode
echo "installing go tool ... pq"
go get github.com/lib/pq
echo "installing go tool ... gorename"
go get golang.org/x/tools/cmd/gorename
echo "installing go tool ... godepgraph"
go get github.com/kisielk/godepgraph
echo "install done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment