From 226e8466274f6c11c1a04eaf0ea3175bfe8288ed Mon Sep 17 00:00:00 2001 From: Rens Rikkerink Date: Mon, 8 Apr 2019 15:50:33 +0200 Subject: [PATCH] Added test to prevent regression on the issue --- src/cmd/go/testdata/script/mod_off_init.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/cmd/go/testdata/script/mod_off_init.txt diff --git a/src/cmd/go/testdata/script/mod_off_init.txt b/src/cmd/go/testdata/script/mod_off_init.txt new file mode 100644 index 0000000000..8dd4bb028c --- /dev/null +++ b/src/cmd/go/testdata/script/mod_off_init.txt @@ -0,0 +1,7 @@ +env GO111MODULE=off + +# This script tests that running go mod init with +# GO111MODULE=off when outside of GOPATH will fatal +# with an error message. +! go mod init +stderr 'go: modules disabled by GO111MODULE=off; see ''go help modules'''