aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2023-07-20 11:41:04 -0700
committerGopher Robot <gobot@golang.org>2023-07-20 21:52:09 +0000
commit82ee946d7acd93cad27f748efb9c3131ae69668e (patch)
treebe4315959067a2c998cdc937d0ba207067ce93f9 /src/cmd/dist
parent9ceba95008f97a913e9176c6ced2b76b50db6ca5 (diff)
downloadgo-82ee946d7acd93cad27f748efb9c3131ae69668e.tar.gz
go-82ee946d7acd93cad27f748efb9c3131ae69668e.zip
all: update build tags to require/assume Go 1.20
Updates #54265. Change-Id: Ia1c9486484c73c565bb4f78234dedff6d929ed42 Reviewed-on: https://go-review.googlesource.com/c/go/+/511656 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/cmd/dist')
-rw-r--r--src/cmd/dist/exec.go (renamed from src/cmd/dist/exec_119.go)3
-rw-r--r--src/cmd/dist/exec_118.go47
-rw-r--r--src/cmd/dist/notgo120.go (renamed from src/cmd/dist/notgo117.go)10
3 files changed, 5 insertions, 55 deletions
diff --git a/src/cmd/dist/exec_119.go b/src/cmd/dist/exec.go
index 0b4baa0065..602b812b00 100644
--- a/src/cmd/dist/exec_119.go
+++ b/src/cmd/dist/exec.go
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build go1.19
-// +build go1.19
-
package main
import (
diff --git a/src/cmd/dist/exec_118.go b/src/cmd/dist/exec_118.go
deleted file mode 100644
index a1c3c64d9e..0000000000
--- a/src/cmd/dist/exec_118.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !go1.19
-// +build !go1.19
-
-package main
-
-import (
- "os"
- "os/exec"
- "strings"
-)
-
-// setDir sets cmd.Dir to dir, and also adds PWD=dir to cmd's environment.
-func setDir(cmd *exec.Cmd, dir string) {
- cmd.Dir = dir
- setEnv(cmd, "PWD", dir)
-}
-
-// setEnv sets cmd.Env so that key = value.
-func setEnv(cmd *exec.Cmd, key, value string) {
- kv := key + "=" + value
- if cmd.Env == nil {
- cmd.Env = os.Environ()
- }
- cmd.Env = append(cmd.Env, kv)
-}
-
-// unsetEnv sets cmd.Env so that key is not present in the environment.
-func unsetEnv(cmd *exec.Cmd, key string) {
- if cmd.Env == nil {
- cmd.Env = os.Environ()
- }
-
- prefix := key + "="
- newEnv := []string{}
- for _, entry := range cmd.Env {
- if strings.HasPrefix(entry, prefix) {
- continue
- }
- newEnv = append(newEnv, entry)
- // key may appear multiple times, so keep going.
- }
- cmd.Env = newEnv
-}
diff --git a/src/cmd/dist/notgo117.go b/src/cmd/dist/notgo120.go
index 8d551df24b..dd7657112f 100644
--- a/src/cmd/dist/notgo117.go
+++ b/src/cmd/dist/notgo120.go
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Go 1.20 and later requires Go 1.17 as the bootstrap toolchain.
+// Go 1.22 and later requires Go 1.20 as the bootstrap toolchain.
// If cmd/dist is built using an earlier Go version, this file will be
// included in the build and cause an error like:
//
// % GOROOT_BOOTSTRAP=$HOME/sdk/go1.16 ./make.bash
// Building Go cmd/dist using /Users/rsc/sdk/go1.16. (go1.16 darwin/amd64)
-// found packages main (build.go) and building_Go_requires_Go_1_17_13_or_later (notgo117.go) in /Users/rsc/go/src/cmd/dist
+// found packages main (build.go) and building_Go_requires_Go_1_20_6_or_later (notgo120.go) in /Users/rsc/go/src/cmd/dist
// %
//
// which is the best we can do under the circumstances.
@@ -16,7 +16,7 @@
// See go.dev/issue/44505 for more background on
// why Go moved on from Go 1.4 for bootstrap.
-//go:build !go1.17
-// +build !go1.17
+//go:build !go1.20
+// +build !go1.20
-package building_Go_requires_Go_1_17_13_or_later
+package building_Go_requires_Go_1_20_6_or_later