summary refs log tree commit diff
path: root/bin/setup-go
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2017-01-27 14:55:31 -0800
committerFranck Cuny <franck.cuny@gmail.com>2017-01-27 14:55:31 -0800
commit113dbbab28c447a4dd5da8a10f700cfc9f993ee4 (patch)
treef23d4040c602dc65138a71eabb9bc4fcf6e95f9e /bin/setup-go
parent[snippets] I won't manage them that way. (diff)
downloademacs.d-113dbbab28c447a4dd5da8a10f700cfc9f993ee4.tar.gz
[bin] Script to make sure Go is installed correctly.
Diffstat (limited to '')
-rwxr-xr-xbin/setup-go22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/setup-go b/bin/setup-go
new file mode 100755
index 0000000..7b0f281
--- /dev/null
+++ b/bin/setup-go
@@ -0,0 +1,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