From b05eb71adf77e3e2c879316316bd405587997e85 Mon Sep 17 00:00:00 2001 From: Adam Eijdenberg Date: Mon, 3 Jun 2019 17:25:48 +1000 Subject: [PATCH] Stop assuming that GOPATH is always set, and is a single directory As of I think go1.8 GOPATH is by default $HOME/go so it is incorrect to assume that it is set. If not set, then the Makefile assumes gometalinter will be in /bin/gometalinter, which it likely is not, and thus fails. We could change configure to set GOPATH in the .env, however then we would be assuming that GOPATH is a single entry - whereas like other paths, it can contain more than one value. So instead this commit stops trying to install gometalinter, and like dep, it assumes that it is installed prior. (and since the current behaviour of the Makefile is affecting state external to the project, that seems more logical) --- Makefile | 9 +-------- configure | 2 ++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0dca566..09ff1bb 100644 --- a/Makefile +++ b/Makefile @@ -15,15 +15,8 @@ clean: distclean: clean rm -rf vendor -BIN_DIR := $(GOPATH)/bin -GOMETALINTER := $(BIN_DIR)/gometalinter - -$(GOMETALINTER): - $(GO) get -u github.com/alecthomas/gometalinter - gometalinter --install %> /dev/null - .PHONY: lint -lint: $(GOMETALINTER) +lint: $(GOMETALINTER) --vendor --disable-all \ --enable=vet \ --enable=vetshadow \ diff --git a/configure b/configure index 24790ab..9d93215 100755 --- a/configure +++ b/configure @@ -126,6 +126,7 @@ check_for go check_go_version check_go_env check_for dep +check_for gometalinter echo @@ -134,6 +135,7 @@ cat <<- EOF > .env GO := "${tools[go]}" GO_VERSION := ${tools[go_version]} DEP := "${tools[dep]}" + GOMETALINTER := "${tools[gometalinter]}" EOF echo "Environment configuration written to .env"