summary refs log tree commit diff
path: root/bin/setup-go
blob: 7b0f281b158f022af1d0314c5e52476f509fcbb1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# This script is idempotent.

# If GOPATH is set, check that it the path exists
if [ -n "${GOPATH}" ]; then
  if [ ! -d "${GOPATH}" ]; then
    echo "$GOPATH is set but the directory does not exist."
    exit 1
  fi
fi

# Check the version
version=$(go version)

# Install extra tools

# These one are for code completion
go get -u github.com/nsf/gocode
go get -u github.com/rogpeppe/godef
go get -u golang.org/x/tools/cmd/guru
go get -u golang.org/x/tools/cmd/goimports