f8ba1e0
From a06043902614314106a259b28546bc8882f2c7e4 Mon Sep 17 00:00:00 2001
f8ba1e0
From: Eli Schwartz <eschwartz@archlinux.org>
f8ba1e0
Date: Sun, 16 Jun 2019 23:46:31 -0400
f8ba1e0
Subject: [PATCH 5/5] build: unexport GOPATH when module vendoring is used
f8ba1e0
f8ba1e0
The go compiler doesn't like it when you mix the two, and Travis CI does
f8ba1e0
exactly that. Take advantage of the opportunity to disable it everywhere
f8ba1e0
else as well.
f8ba1e0
---
f8ba1e0
 Makefile | 4 ++++
f8ba1e0
 1 file changed, 4 insertions(+)
f8ba1e0
f8ba1e0
diff --git a/Makefile b/Makefile
f8ba1e0
index c422ef2490bbf85cc2b340330a0666fbff6373bd..679d253946b7ec0048e422d27a16d90b89b32dd2 100644
f8ba1e0
--- a/Makefile
f8ba1e0
+++ b/Makefile
f8ba1e0
@@ -6,10 +6,14 @@ FLAGS_ALL = $(shell go version | grep -q 'go1.[89]' || echo 'all=')
f8ba1e0
 export MOD_VENDOR_ARG := $(shell go version | grep -q 'go1.1[^0]' && echo '-mod=vendor')
f8ba1e0
 export LDFLAGS := -extldflags '$(LDFLAGS)'
f8ba1e0
 export GCFLAGS := $(FLAGS_ALL)
f8ba1e0
 export ASMFLAGS := $(FLAGS_ALL)
f8ba1e0
 
f8ba1e0
+ifneq ($(MOD_VENDOR_ARG),)
f8ba1e0
+	unexport GOPATH
f8ba1e0
+endif
f8ba1e0
+
f8ba1e0
 MIN_COVERAGE = 89.4
f8ba1e0
 
f8ba1e0
 HELP_CMD = \
f8ba1e0
 	share/man/man1/hub-alias.1 \
f8ba1e0
 	share/man/man1/hub-api.1 \
f8ba1e0
-- 
f8ba1e0
2.21.0
f8ba1e0