From b05eb71adf77e3e2c879316316bd405587997e85 Mon Sep 17 00:00:00 2001 From: Adam Eijdenberg Date: Mon, 3 Jun 2019 17:25:48 +1000 Subject: [PATCH 1/3] 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" From e7d29590cd718e68fb2397c0416f0e7eabe884da Mon Sep 17 00:00:00 2001 From: Adam Eijdenberg Date: Mon, 3 Jun 2019 17:47:51 +1000 Subject: [PATCH 2/3] Fix travis so that if "configure" fails, it doesn't try to run make --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5cdc33..ac0f582 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,7 @@ install: - chmod +x dep - mv dep $GOPATH/bin/dep script: - - ./configure - # Run tests - - make test + - ./configure && make test sudo: false notifications: email: false From 37475637cdd632405d42776a4820208badfa641f Mon Sep 17 00:00:00 2001 From: Adam Eijdenberg Date: Mon, 3 Jun 2019 17:50:22 +1000 Subject: [PATCH 3/3] Install gometalinter in travis instead --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index ac0f582..fcdfbff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ install: - wget -O dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 - chmod +x dep - mv dep $GOPATH/bin/dep + - go get github.com/alecthomas/gometalinter + - gometalinter --install script: - ./configure && make test sudo: false