diff options
author | Jay Conrod <jayconrod@google.com> | 2020-09-15 12:59:05 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2020-09-17 13:25:29 +0000 |
commit | 5abba0c73723a843315c0f7ed014617445af6243 (patch) | |
tree | 2c006f546ad8c1d956b3be67d63d3884e3014259 /src/cmd/go/internal/modload/build.go | |
parent | 967465da2975fe4322080703ce5a77ea90752829 (diff) | |
download | go-5abba0c73723a843315c0f7ed014617445af6243.tar.gz go-5abba0c73723a843315c0f7ed014617445af6243.zip |
cmd/go: prepare tests for GO111MODULE=on by default
Set GO111MODULE=off explicitly in tests specific to GOPATH mode.
Added a go.mod file to other tests that assumed GOPATH mode.
Fixed an issue in the build metadata file generated in
modload/build.go, which did not end with a newline. This broke the
build_dash_x test, which expects to be able to run the script printed
by 'go build -x' to produce the same result. The script is broken if
the build metadata file doesn't end with a newline.
Change-Id: I59f2a492a9f5a66f6c4aa702f429909d5c5e815d
Reviewed-on: https://go-review.googlesource.com/c/go/+/255051
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/build.go')
-rw-r--r-- | src/cmd/go/internal/modload/build.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/modload/build.go b/src/cmd/go/internal/modload/build.go index 9ca6230500..2c7cfb732d 100644 --- a/src/cmd/go/internal/modload/build.go +++ b/src/cmd/go/internal/modload/build.go @@ -355,13 +355,13 @@ func ModInfoProg(info string, isgccgo bool) []byte { import _ "unsafe" //go:linkname __debug_modinfo__ runtime.modinfo var __debug_modinfo__ = %q - `, string(infoStart)+info+string(infoEnd))) +`, string(infoStart)+info+string(infoEnd))) } else { return []byte(fmt.Sprintf(`package main import _ "unsafe" //go:linkname __set_debug_modinfo__ runtime.setmodinfo func __set_debug_modinfo__(string) func init() { __set_debug_modinfo__(%q) } - `, string(infoStart)+info+string(infoEnd))) +`, string(infoStart)+info+string(infoEnd))) } } |