From 66165739828b8326b625463beb51ae510b2ab8dd Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 30 Sep 2022 00:45:12 +0200 Subject: [PATCH] cmd/cgo, cmd/compile, cmd/link: remove old style build tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The minimum bootstrap version for Go ≥ 1.20 is Go 1.17. That version supports the new style //go:build lines. Thus the old style //+build lines can be dropped in this part of the tree as well. Leave the //+build lines in cmd/dist which will ensure the minimum Go version during bootstrap. As suggested by Cherry during review of CL 430496 For #44505 Change-Id: If53c0b02cacbfb055a33e73cfd38578dfd3aa340 Reviewed-on: https://go-review.googlesource.com/c/go/+/436915 TryBot-Result: Gopher Robot Reviewed-by: Cherry Mui Run-TryBot: Tobias Klauser Auto-Submit: Tobias Klauser Reviewed-by: Than McIntosh --- src/cmd/cgo/ast_go1.go | 1 - src/cmd/cgo/ast_go118.go | 1 - src/cmd/compile/internal/base/bootstrap_false.go | 1 - src/cmd/compile/internal/base/bootstrap_true.go | 1 - src/cmd/compile/internal/base/mapfile_mmap.go | 1 - src/cmd/compile/internal/base/mapfile_read.go | 7 ------- src/cmd/compile/internal/ir/mknode.go | 1 - src/cmd/compile/internal/ssa/flags_test.go | 1 - src/cmd/compile/internal/ssa/gen/386Ops.go | 1 - src/cmd/compile/internal/ssa/gen/AMD64Ops.go | 1 - src/cmd/compile/internal/ssa/gen/ARM64Ops.go | 1 - src/cmd/compile/internal/ssa/gen/ARMOps.go | 1 - src/cmd/compile/internal/ssa/gen/LOONG64Ops.go | 1 - src/cmd/compile/internal/ssa/gen/MIPS64Ops.go | 1 - src/cmd/compile/internal/ssa/gen/MIPSOps.go | 1 - src/cmd/compile/internal/ssa/gen/PPC64Ops.go | 1 - src/cmd/compile/internal/ssa/gen/RISCV64Ops.go | 1 - src/cmd/compile/internal/ssa/gen/S390XOps.go | 1 - src/cmd/compile/internal/ssa/gen/WasmOps.go | 1 - src/cmd/compile/internal/ssa/gen/dec64Ops.go | 1 - src/cmd/compile/internal/ssa/gen/decOps.go | 1 - src/cmd/compile/internal/ssa/gen/genericOps.go | 1 - src/cmd/compile/internal/ssa/gen/main.go | 1 - src/cmd/compile/internal/ssa/gen/rulegen.go | 1 - src/cmd/compile/internal/typecheck/builtin/runtime.go | 1 - src/cmd/compile/internal/typecheck/mkbuiltin.go | 1 - src/cmd/compile/internal/types2/example_test.go | 1 - src/cmd/internal/bio/buf_mmap.go | 1 - src/cmd/internal/bio/buf_nommap.go | 7 ------- src/cmd/link/elf_test.go | 1 - src/cmd/link/internal/ld/outbuf_mmap.go | 1 - src/cmd/link/internal/ld/outbuf_nofallocate.go | 1 - src/cmd/link/internal/ld/outbuf_nommap.go | 9 --------- 33 files changed, 53 deletions(-) diff --git a/src/cmd/cgo/ast_go1.go b/src/cmd/cgo/ast_go1.go index f52bf00d7cb94..ce61d29095585 100644 --- a/src/cmd/cgo/ast_go1.go +++ b/src/cmd/cgo/ast_go1.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build compiler_bootstrap -// +build compiler_bootstrap package main diff --git a/src/cmd/cgo/ast_go118.go b/src/cmd/cgo/ast_go118.go index db0108ed72683..9f759b8ee5f0f 100644 --- a/src/cmd/cgo/ast_go118.go +++ b/src/cmd/cgo/ast_go118.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !compiler_bootstrap -// +build !compiler_bootstrap package main diff --git a/src/cmd/compile/internal/base/bootstrap_false.go b/src/cmd/compile/internal/base/bootstrap_false.go index c77fcd730812d..ea6da4348f539 100644 --- a/src/cmd/compile/internal/base/bootstrap_false.go +++ b/src/cmd/compile/internal/base/bootstrap_false.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !compiler_bootstrap -// +build !compiler_bootstrap package base diff --git a/src/cmd/compile/internal/base/bootstrap_true.go b/src/cmd/compile/internal/base/bootstrap_true.go index 1eb58b2f9dc1c..d0c6c88f56f94 100644 --- a/src/cmd/compile/internal/base/bootstrap_true.go +++ b/src/cmd/compile/internal/base/bootstrap_true.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build compiler_bootstrap -// +build compiler_bootstrap package base diff --git a/src/cmd/compile/internal/base/mapfile_mmap.go b/src/cmd/compile/internal/base/mapfile_mmap.go index b01d0f4efc664..6c5a4213a2fda 100644 --- a/src/cmd/compile/internal/base/mapfile_mmap.go +++ b/src/cmd/compile/internal/base/mapfile_mmap.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || (solaris && go1.20) -// +build darwin dragonfly freebsd linux netbsd openbsd solaris,go1.20 package base diff --git a/src/cmd/compile/internal/base/mapfile_read.go b/src/cmd/compile/internal/base/mapfile_read.go index e84810ea347ee..5ac6272dc1522 100644 --- a/src/cmd/compile/internal/base/mapfile_read.go +++ b/src/cmd/compile/internal/base/mapfile_read.go @@ -3,13 +3,6 @@ // license that can be found in the LICENSE file. //go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !(solaris && go1.20) -// +build !darwin -// +build !dragonfly -// +build !freebsd -// +build !linux -// +build !netbsd -// +build !openbsd -// +build !solaris !go1.20 package base diff --git a/src/cmd/compile/internal/ir/mknode.go b/src/cmd/compile/internal/ir/mknode.go index 68d8999f832bf..caf4ba01358cd 100644 --- a/src/cmd/compile/internal/ir/mknode.go +++ b/src/cmd/compile/internal/ir/mknode.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // Note: this program must be run in this directory. // go run mknode.go diff --git a/src/cmd/compile/internal/ssa/flags_test.go b/src/cmd/compile/internal/ssa/flags_test.go index 0bc1097199464..d0079ac5e8382 100644 --- a/src/cmd/compile/internal/ssa/flags_test.go +++ b/src/cmd/compile/internal/ssa/flags_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 || arm64 -// +build amd64 arm64 package ssa diff --git a/src/cmd/compile/internal/ssa/gen/386Ops.go b/src/cmd/compile/internal/ssa/gen/386Ops.go index 88e061151e10e..4b7fe9fe370e4 100644 --- a/src/cmd/compile/internal/ssa/gen/386Ops.go +++ b/src/cmd/compile/internal/ssa/gen/386Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go index fc42fa5e28b82..65456a8f773e0 100644 --- a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/ARM64Ops.go b/src/cmd/compile/internal/ssa/gen/ARM64Ops.go index 0e6e6e4a5f3db..4ef949a179848 100644 --- a/src/cmd/compile/internal/ssa/gen/ARM64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/ARM64Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/ARMOps.go b/src/cmd/compile/internal/ssa/gen/ARMOps.go index 3803f273c1daf..99684e4e03935 100644 --- a/src/cmd/compile/internal/ssa/gen/ARMOps.go +++ b/src/cmd/compile/internal/ssa/gen/ARMOps.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/LOONG64Ops.go b/src/cmd/compile/internal/ssa/gen/LOONG64Ops.go index a59b592445ac0..fdf42ec944df5 100644 --- a/src/cmd/compile/internal/ssa/gen/LOONG64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/LOONG64Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go b/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go index 7b18c42ffb91e..59a9c8c7144fd 100644 --- a/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/MIPSOps.go b/src/cmd/compile/internal/ssa/gen/MIPSOps.go index 523847badc9ce..17ae3d4251716 100644 --- a/src/cmd/compile/internal/ssa/gen/MIPSOps.go +++ b/src/cmd/compile/internal/ssa/gen/MIPSOps.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/PPC64Ops.go b/src/cmd/compile/internal/ssa/gen/PPC64Ops.go index 30a6f6fe07d4b..4428ea62a78fb 100644 --- a/src/cmd/compile/internal/ssa/gen/PPC64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/PPC64Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/RISCV64Ops.go b/src/cmd/compile/internal/ssa/gen/RISCV64Ops.go index f09910782d5e2..1d2d22643d064 100644 --- a/src/cmd/compile/internal/ssa/gen/RISCV64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/RISCV64Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/S390XOps.go b/src/cmd/compile/internal/ssa/gen/S390XOps.go index eef8a2557ca39..29cb260d87729 100644 --- a/src/cmd/compile/internal/ssa/gen/S390XOps.go +++ b/src/cmd/compile/internal/ssa/gen/S390XOps.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/WasmOps.go b/src/cmd/compile/internal/ssa/gen/WasmOps.go index edfba4ee99b77..1ba94eaa5fc22 100644 --- a/src/cmd/compile/internal/ssa/gen/WasmOps.go +++ b/src/cmd/compile/internal/ssa/gen/WasmOps.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/dec64Ops.go b/src/cmd/compile/internal/ssa/gen/dec64Ops.go index 78fcea885aa8b..24b23c00b7c6a 100644 --- a/src/cmd/compile/internal/ssa/gen/dec64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/dec64Ops.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/decOps.go b/src/cmd/compile/internal/ssa/gen/decOps.go index d5cd79378c76a..5449727a8a47d 100644 --- a/src/cmd/compile/internal/ssa/gen/decOps.go +++ b/src/cmd/compile/internal/ssa/gen/decOps.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/genericOps.go b/src/cmd/compile/internal/ssa/gen/genericOps.go index d09b9aab7573a..df649eeece50b 100644 --- a/src/cmd/compile/internal/ssa/gen/genericOps.go +++ b/src/cmd/compile/internal/ssa/gen/genericOps.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main diff --git a/src/cmd/compile/internal/ssa/gen/main.go b/src/cmd/compile/internal/ssa/gen/main.go index 81740dcf1c02a..fd00df680dc8d 100644 --- a/src/cmd/compile/internal/ssa/gen/main.go +++ b/src/cmd/compile/internal/ssa/gen/main.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // The gen command generates Go code (in the parent directory) for all // the architecture-specific opcodes, blocks, and rewrites. diff --git a/src/cmd/compile/internal/ssa/gen/rulegen.go b/src/cmd/compile/internal/ssa/gen/rulegen.go index fc9b4c9b3e74b..d7b4cfa612253 100644 --- a/src/cmd/compile/internal/ssa/gen/rulegen.go +++ b/src/cmd/compile/internal/ssa/gen/rulegen.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gen -// +build gen // This program generates Go code that applies rewrite rules to a Value. // The generated code implements a function of type func (v *Value) bool diff --git a/src/cmd/compile/internal/typecheck/builtin/runtime.go b/src/cmd/compile/internal/typecheck/builtin/runtime.go index 310148ce00ca4..83695013c39cf 100644 --- a/src/cmd/compile/internal/typecheck/builtin/runtime.go +++ b/src/cmd/compile/internal/typecheck/builtin/runtime.go @@ -7,7 +7,6 @@ // to avoid depending on having a working compiler binary. //go:build ignore -// +build ignore package runtime diff --git a/src/cmd/compile/internal/typecheck/mkbuiltin.go b/src/cmd/compile/internal/typecheck/mkbuiltin.go index aa3a94a19a4f9..4def95ebd66f9 100644 --- a/src/cmd/compile/internal/typecheck/mkbuiltin.go +++ b/src/cmd/compile/internal/typecheck/mkbuiltin.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // Generate builtin.go from builtin/runtime.go. diff --git a/src/cmd/compile/internal/types2/example_test.go b/src/cmd/compile/internal/types2/example_test.go index ad0f22fcec4c8..9212c38560b16 100644 --- a/src/cmd/compile/internal/types2/example_test.go +++ b/src/cmd/compile/internal/types2/example_test.go @@ -6,7 +6,6 @@ // access to compiled packages for import. // //go:build !arm && !arm64 -// +build !arm,!arm64 package types2_test diff --git a/src/cmd/internal/bio/buf_mmap.go b/src/cmd/internal/bio/buf_mmap.go index 3543637154312..e428952bc9f09 100644 --- a/src/cmd/internal/bio/buf_mmap.go +++ b/src/cmd/internal/bio/buf_mmap.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || (solaris && go1.20) -// +build darwin dragonfly freebsd linux netbsd openbsd solaris,go1.20 package bio diff --git a/src/cmd/internal/bio/buf_nommap.go b/src/cmd/internal/bio/buf_nommap.go index dab3435260a14..e9048609831a2 100644 --- a/src/cmd/internal/bio/buf_nommap.go +++ b/src/cmd/internal/bio/buf_nommap.go @@ -3,13 +3,6 @@ // license that can be found in the LICENSE file. //go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !(solaris && go1.20) -// +build !darwin -// +build !dragonfly -// +build !freebsd -// +build !linux -// +build !netbsd -// +build !openbsd -// +build !solaris !go1.20 package bio diff --git a/src/cmd/link/elf_test.go b/src/cmd/link/elf_test.go index 5037f5b6c0d4b..6a94b264a1b36 100644 --- a/src/cmd/link/elf_test.go +++ b/src/cmd/link/elf_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build dragonfly || freebsd || linux || netbsd || openbsd -// +build dragonfly freebsd linux netbsd openbsd package main diff --git a/src/cmd/link/internal/ld/outbuf_mmap.go b/src/cmd/link/internal/ld/outbuf_mmap.go index d8f8a10db137f..7bb728a1f895d 100644 --- a/src/cmd/link/internal/ld/outbuf_mmap.go +++ b/src/cmd/link/internal/ld/outbuf_mmap.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || (solaris && go1.20) -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris,go1.20 package ld diff --git a/src/cmd/link/internal/ld/outbuf_nofallocate.go b/src/cmd/link/internal/ld/outbuf_nofallocate.go index 6564bd54a3d1b..dd5afc61db928 100644 --- a/src/cmd/link/internal/ld/outbuf_nofallocate.go +++ b/src/cmd/link/internal/ld/outbuf_nofallocate.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !darwin && !linux -// +build !darwin,!linux package ld diff --git a/src/cmd/link/internal/ld/outbuf_nommap.go b/src/cmd/link/internal/ld/outbuf_nommap.go index 4154981b099df..b1d3d2724f01a 100644 --- a/src/cmd/link/internal/ld/outbuf_nommap.go +++ b/src/cmd/link/internal/ld/outbuf_nommap.go @@ -3,15 +3,6 @@ // license that can be found in the LICENSE file. //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !(solaris && go1.20) && !windows -// +build !aix -// +build !darwin -// +build !dragonfly -// +build !freebsd -// +build !linux -// +build !netbsd -// +build !openbsd -// +build !solaris !go1.20 -// +build !windows package ld