From b83eac242a662ebdb1fdecaeba8ae33db7e2866d Mon Sep 17 00:00:00 2001 From: "Iskander (Alex) Sharipov" Date: Thu, 3 Jan 2019 10:19:48 +0000 Subject: [PATCH] linttest: disable Go modules inside integration tests (#63) Fixes #62 Signed-off-by: Iskander Sharipov --- linttest/integration.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linttest/integration.go b/linttest/integration.go index 8fb8bbe..623fcea 100644 --- a/linttest/integration.go +++ b/linttest/integration.go @@ -93,7 +93,12 @@ func (cfg *IntegrationTest) runTest(t *testing.T, linter, gopath string) { // Get the actual execution output. cmd := exec.Command(linter, runParams...) cmd.Env = append([]string{}, os.Environ()...) // Copy parent env - cmd.Env = append(cmd.Env, "GOPATH="+gopath) // Override GOPATH + cmd.Env = append(cmd.Env, + // Override GOPATH. + "GOPATH="+gopath, + // Disable modules. See #62. + "GO111MODULE=off") + out, err := cmd.CombinedOutput() out = bytes.TrimSpace(out) var have string