]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: add explicit module version to generated go.mod
authorDavid Chase <drchase@google.com>
Fri, 5 May 2023 15:23:29 +0000 (11:23 -0400)
committerDavid Chase <drchase@google.com>
Fri, 5 May 2023 15:46:57 +0000 (15:46 +0000)
This avoids bootstrapping problems with 1.20.
Tested w/ 1.19 and 1.20.

Change-Id: I0ca9e111719e8c1bcd1a0b53b9f16d9a2d77e836
Reviewed-on: https://go-review.googlesource.com/c/go/+/492982
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/dist/buildtool.go

index bb36c076637b06f2e9540b2699a533eee00e7196..af3db5f59023bd9e99fdef6884cac49ca2c3de8d 100644 (file)
@@ -136,7 +136,7 @@ func bootstrapBuildTools() {
        xmkdirall(base)
 
        // Copy source code into $GOROOT/pkg/bootstrap and rewrite import paths.
-       writefile("module bootstrap\n", pathf("%s/%s", base, "go.mod"), 0)
+       writefile("module bootstrap\ngo 1.20\n", pathf("%s/%s", base, "go.mod"), 0)
        for _, dir := range bootstrapDirs {
                recurse := strings.HasSuffix(dir, "/...")
                dir = strings.TrimSuffix(dir, "/...")