From bf97e724b50303e721d62b59cca726a679d492ce Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov <dmitshur@golang.org> Date: Tue, 17 Oct 2023 15:19:33 -0400 Subject: [PATCH] all: drop old +build lines Running 'go fix' on the cmd+std packages handled much of this change. Also update code generators to use only the new go:build lines, not the old +build ones. For #41184. For #60268. Change-Id: If35532abe3012e7357b02c79d5992ff5ac37ca23 Cq-Include-Trybots: luci.golang.try:gotip-linux-386-longtest,gotip-linux-amd64-longtest,gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/536237 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> --- src/cmd/compile/internal/ssa/_gen/cover.bash | 2 +- src/cmd/compile/internal/typecheck/_builtin/coverage.go | 1 - src/cmd/dist/notgo120.go | 1 - src/cmd/dist/sys_default.go | 1 - src/cmd/dist/util_gc.go | 1 - src/cmd/dist/util_gccgo.go | 1 - src/cmd/dist/vfp_arm.s | 1 - src/cmd/dist/vfp_default.s | 1 - src/cmd/go/internal/modcmd/vendor.go | 2 +- src/cmd/go/internal/modload/import.go | 2 +- src/cmd/internal/goobj/mkbuiltin.go | 1 - src/cmd/internal/notsha256/sha256block_386.s | 1 - src/cmd/internal/notsha256/sha256block_amd64.go | 1 - src/cmd/internal/notsha256/sha256block_amd64.s | 1 - src/cmd/internal/notsha256/sha256block_decl.go | 2 -- src/cmd/internal/notsha256/sha256block_generic.go | 1 - src/cmd/internal/notsha256/sha256block_ppc64x.s | 2 -- src/cmd/internal/obj/stringer.go | 1 - src/cmd/link/internal/ld/elf_test.go | 1 - src/cmd/link/internal/ld/execarchive.go | 1 - src/cmd/link/internal/ld/execarchive_noexec.go | 1 - src/crypto/boring/notboring_test.go | 1 - src/crypto/internal/boring/sig/sig_other.s | 1 - src/crypto/internal/edwards25519/field/fe_arm64.s | 2 +- src/internal/goexperiment/exp_arenas_off.go | 1 - src/internal/goexperiment/exp_arenas_on.go | 1 - src/internal/goexperiment/exp_boringcrypto_off.go | 1 - src/internal/goexperiment/exp_boringcrypto_on.go | 1 - src/internal/goexperiment/exp_cacheprog_off.go | 1 - src/internal/goexperiment/exp_cacheprog_on.go | 1 - src/internal/goexperiment/exp_cgocheck2_off.go | 1 - src/internal/goexperiment/exp_cgocheck2_on.go | 1 - src/internal/goexperiment/exp_coverageredesign_off.go | 1 - src/internal/goexperiment/exp_coverageredesign_on.go | 1 - src/internal/goexperiment/exp_fieldtrack_off.go | 1 - src/internal/goexperiment/exp_fieldtrack_on.go | 1 - src/internal/goexperiment/exp_heapminimum512kib_off.go | 1 - src/internal/goexperiment/exp_heapminimum512kib_on.go | 1 - src/internal/goexperiment/exp_loopvar_off.go | 1 - src/internal/goexperiment/exp_loopvar_on.go | 1 - src/internal/goexperiment/exp_newinliner_off.go | 1 - src/internal/goexperiment/exp_newinliner_on.go | 1 - src/internal/goexperiment/exp_pagetrace_off.go | 1 - src/internal/goexperiment/exp_pagetrace_on.go | 1 - src/internal/goexperiment/exp_preemptibleloops_off.go | 1 - src/internal/goexperiment/exp_preemptibleloops_on.go | 1 - src/internal/goexperiment/exp_range_off.go | 1 - src/internal/goexperiment/exp_range_on.go | 1 - src/internal/goexperiment/exp_regabiargs_off.go | 1 - src/internal/goexperiment/exp_regabiargs_on.go | 1 - src/internal/goexperiment/exp_regabiwrappers_off.go | 1 - src/internal/goexperiment/exp_regabiwrappers_on.go | 1 - src/internal/goexperiment/exp_staticlockranking_off.go | 1 - src/internal/goexperiment/exp_staticlockranking_on.go | 1 - src/internal/goexperiment/mkconsts.go | 4 +--- src/internal/race/norace.go | 1 - src/internal/race/race.go | 1 - src/math/big/arith_386.s | 1 - src/math/big/arith_amd64.go | 1 - src/math/big/arith_amd64.s | 1 - src/math/big/arith_arm.s | 1 - src/math/big/arith_arm64.s | 1 - src/math/big/arith_decl.go | 1 - src/math/big/arith_decl_pure.go | 1 - src/math/big/arith_decl_s390x.go | 1 - src/math/big/arith_loong64.s | 2 +- src/math/big/arith_mips64x.s | 2 -- src/math/big/arith_mipsx.s | 2 -- src/math/big/arith_ppc64x.s | 2 -- src/math/big/arith_riscv64.s | 1 - src/math/big/arith_s390x.s | 1 - src/math/big/arith_s390x_test.go | 1 - src/math/big/arith_wasm.s | 1 - src/math/bits/bits_errors.go | 1 - src/math/bits/bits_errors_bootstrap.go | 1 - src/math/bits/make_examples.go | 1 - src/math/bits/make_tables.go | 1 - src/math/floor_ppc64x.s | 1 - src/math/modf_ppc64x.s | 1 - src/net/http/h2_error.go | 1 - src/net/http/h2_error_test.go | 1 - src/net/sendfile_linux_test.go | 1 - src/runtime/internal/atomic/atomic_andor_test.go | 1 - src/runtime/race_s390x.s | 1 - src/runtime/vdso_linux_s390x.go | 1 - src/sort/gen_sort_variants.go | 1 - src/strconv/bytealg.go | 1 - src/strconv/bytealg_bootstrap.go | 1 - src/strconv/makeisprint.go | 1 - 89 files changed, 6 insertions(+), 96 deletions(-) diff --git a/src/cmd/compile/internal/ssa/_gen/cover.bash b/src/cmd/compile/internal/ssa/_gen/cover.bash index 7311cfb5f39..733f9db2c2e 100755 --- a/src/cmd/compile/internal/ssa/_gen/cover.bash +++ b/src/cmd/compile/internal/ssa/_gen/cover.bash @@ -12,7 +12,7 @@ # regular 'go run .' usage to run the generator. cat >main_test.go <<-EOF - // +build ignore + //go:build ignore package main diff --git a/src/cmd/compile/internal/typecheck/_builtin/coverage.go b/src/cmd/compile/internal/typecheck/_builtin/coverage.go index ea4462dd978..02226356bc9 100644 --- a/src/cmd/compile/internal/typecheck/_builtin/coverage.go +++ b/src/cmd/compile/internal/typecheck/_builtin/coverage.go @@ -7,7 +7,6 @@ // to avoid depending on having a working compiler binary. //go:build ignore -// +build ignore package coverage diff --git a/src/cmd/dist/notgo120.go b/src/cmd/dist/notgo120.go index dd7657112fc..0b89ab3c022 100644 --- a/src/cmd/dist/notgo120.go +++ b/src/cmd/dist/notgo120.go @@ -17,6 +17,5 @@ // why Go moved on from Go 1.4 for bootstrap. //go:build !go1.20 -// +build !go1.20 package building_Go_requires_Go_1_20_6_or_later diff --git a/src/cmd/dist/sys_default.go b/src/cmd/dist/sys_default.go index e87c84ce3ee..ae102270c34 100644 --- a/src/cmd/dist/sys_default.go +++ b/src/cmd/dist/sys_default.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !windows -// +build !windows package main diff --git a/src/cmd/dist/util_gc.go b/src/cmd/dist/util_gc.go index 875784d3830..6efdf23e604 100644 --- a/src/cmd/dist/util_gc.go +++ b/src/cmd/dist/util_gc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc package main diff --git a/src/cmd/dist/util_gccgo.go b/src/cmd/dist/util_gccgo.go index 3255b803652..2f7af7ed662 100644 --- a/src/cmd/dist/util_gccgo.go +++ b/src/cmd/dist/util_gccgo.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gccgo -// +build gccgo package main diff --git a/src/cmd/dist/vfp_arm.s b/src/cmd/dist/vfp_arm.s index 525ee9b3661..37fb4061af9 100644 --- a/src/cmd/dist/vfp_arm.s +++ b/src/cmd/dist/vfp_arm.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/src/cmd/dist/vfp_default.s b/src/cmd/dist/vfp_default.s index 0c1e16b0aa0..a766edac286 100644 --- a/src/cmd/dist/vfp_default.s +++ b/src/cmd/dist/vfp_default.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc && !arm -// +build gc,!arm #include "textflag.h" diff --git a/src/cmd/go/internal/modcmd/vendor.go b/src/cmd/go/internal/modcmd/vendor.go index e95dfbfbb7d..3db85bda530 100644 --- a/src/cmd/go/internal/modcmd/vendor.go +++ b/src/cmd/go/internal/modcmd/vendor.go @@ -299,7 +299,7 @@ func vendorPkg(vdir, pkg string) { // a MultiplePackageError on an otherwise valid package: the package could // have different names for GOOS=windows and GOOS=mac for example. On the // other hand if there's a NoGoError, the package might have source files - // specifying "// +build ignore" those packages should be skipped because + // specifying "//go:build ignore" those packages should be skipped because // embeds from ignored files can't be used. // TODO(#42504): Find a better way to avoid errors from ImportDir. We'll // need to figure this out when we switch to PackagesAndErrors as per the diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go index cc6a482fd45..7cd5fcf36a6 100644 --- a/src/cmd/go/internal/modload/import.go +++ b/src/cmd/go/internal/modload/import.go @@ -706,7 +706,7 @@ func dirInModule(path, mpath, mdir string, isLocal bool) (dir string, haveGoFile // Now committed to returning dir (not ""). // Are there Go source files in the directory? - // We don't care about build tags, not even "+build ignore". + // We don't care about build tags, not even "go:build ignore". // We're just looking for a plausible directory. haveGoFiles, err = haveGoFilesCache.Do(dir, func() (bool, error) { // modindex.GetPackage will return ErrNotIndexed for any directories which diff --git a/src/cmd/internal/goobj/mkbuiltin.go b/src/cmd/internal/goobj/mkbuiltin.go index aefb19b5e37..5ddf0e7d9a9 100644 --- a/src/cmd/internal/goobj/mkbuiltin.go +++ b/src/cmd/internal/goobj/mkbuiltin.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // Generate builtinlist.go from cmd/compile/internal/typecheck/builtin/runtime.go. diff --git a/src/cmd/internal/notsha256/sha256block_386.s b/src/cmd/internal/notsha256/sha256block_386.s index f2ba7d7a9b7..0e27fa02d7e 100644 --- a/src/cmd/internal/notsha256/sha256block_386.s +++ b/src/cmd/internal/notsha256/sha256block_386.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !purego -// +build !purego // SHA256 block routine. See sha256block.go for Go equivalent. // diff --git a/src/cmd/internal/notsha256/sha256block_amd64.go b/src/cmd/internal/notsha256/sha256block_amd64.go index 27b84a86b12..6a615e096f8 100644 --- a/src/cmd/internal/notsha256/sha256block_amd64.go +++ b/src/cmd/internal/notsha256/sha256block_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !purego -// +build !purego package notsha256 diff --git a/src/cmd/internal/notsha256/sha256block_amd64.s b/src/cmd/internal/notsha256/sha256block_amd64.s index 36ea74451d1..b25c979e9bc 100644 --- a/src/cmd/internal/notsha256/sha256block_amd64.s +++ b/src/cmd/internal/notsha256/sha256block_amd64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !purego -// +build !purego #include "textflag.h" diff --git a/src/cmd/internal/notsha256/sha256block_decl.go b/src/cmd/internal/notsha256/sha256block_decl.go index da66bdd26ab..ab3f7d294be 100644 --- a/src/cmd/internal/notsha256/sha256block_decl.go +++ b/src/cmd/internal/notsha256/sha256block_decl.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build !purego && (386 || amd64 || ppc64le || ppc64) -// +build !purego -// +build 386 amd64 ppc64le ppc64 package notsha256 diff --git a/src/cmd/internal/notsha256/sha256block_generic.go b/src/cmd/internal/notsha256/sha256block_generic.go index 2664722bc2f..76d53728ab3 100644 --- a/src/cmd/internal/notsha256/sha256block_generic.go +++ b/src/cmd/internal/notsha256/sha256block_generic.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build purego || (!amd64 && !386 && !ppc64le && !ppc64) -// +build purego !amd64,!386,!ppc64le,!ppc64 package notsha256 diff --git a/src/cmd/internal/notsha256/sha256block_ppc64x.s b/src/cmd/internal/notsha256/sha256block_ppc64x.s index ea4417d6c6b..93e85509eaa 100644 --- a/src/cmd/internal/notsha256/sha256block_ppc64x.s +++ b/src/cmd/internal/notsha256/sha256block_ppc64x.s @@ -9,8 +9,6 @@ // //go:build !purego && (ppc64 || ppc64le) -// +build !purego -// +build ppc64 ppc64le // Based on CRYPTOGAMS code with the following comment: // # ==================================================================== diff --git a/src/cmd/internal/obj/stringer.go b/src/cmd/internal/obj/stringer.go index a4d507d49aa..b2b0df83ad0 100644 --- a/src/cmd/internal/obj/stringer.go +++ b/src/cmd/internal/obj/stringer.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // This is a mini version of the stringer tool customized for the Anames table // in the architecture support for obj. diff --git a/src/cmd/link/internal/ld/elf_test.go b/src/cmd/link/internal/ld/elf_test.go index f5f5e8ef4eb..e535af6a1c2 100644 --- a/src/cmd/link/internal/ld/elf_test.go +++ b/src/cmd/link/internal/ld/elf_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build cgo -// +build cgo package ld diff --git a/src/cmd/link/internal/ld/execarchive.go b/src/cmd/link/internal/ld/execarchive.go index a9376e96a4b..7a19567a6c9 100644 --- a/src/cmd/link/internal/ld/execarchive.go +++ b/src/cmd/link/internal/ld/execarchive.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !wasm && !windows -// +build !wasm,!windows package ld diff --git a/src/cmd/link/internal/ld/execarchive_noexec.go b/src/cmd/link/internal/ld/execarchive_noexec.go index 5e1f2669d3c..ada3e9f74aa 100644 --- a/src/cmd/link/internal/ld/execarchive_noexec.go +++ b/src/cmd/link/internal/ld/execarchive_noexec.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build wasm || windows -// +build wasm windows package ld diff --git a/src/crypto/boring/notboring_test.go b/src/crypto/boring/notboring_test.go index ffe18e9109a..07016284649 100644 --- a/src/crypto/boring/notboring_test.go +++ b/src/crypto/boring/notboring_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build (goexperiment.boringcrypto && !boringcrypto) || (!goexperiment.boringcrypto && boringcrypto) -// +build goexperiment.boringcrypto,!boringcrypto !goexperiment.boringcrypto,boringcrypto package boring_test diff --git a/src/crypto/internal/boring/sig/sig_other.s b/src/crypto/internal/boring/sig/sig_other.s index 2bbb1df3013..f7ef4cd5b82 100644 --- a/src/crypto/internal/boring/sig/sig_other.s +++ b/src/crypto/internal/boring/sig/sig_other.s @@ -8,7 +8,6 @@ // On other platforms (those using this source file), they don't. //go:build !amd64 -// +build !amd64 TEXT ·BoringCrypto(SB),$0 RET diff --git a/src/crypto/internal/edwards25519/field/fe_arm64.s b/src/crypto/internal/edwards25519/field/fe_arm64.s index 751ab2ada3a..3126a434191 100644 --- a/src/crypto/internal/edwards25519/field/fe_arm64.s +++ b/src/crypto/internal/edwards25519/field/fe_arm64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm64,gc,!purego +//go:build arm64 && gc && !purego #include "textflag.h" diff --git a/src/internal/goexperiment/exp_arenas_off.go b/src/internal/goexperiment/exp_arenas_off.go index 9e40ebc37b0..01f5332e5cb 100644 --- a/src/internal/goexperiment/exp_arenas_off.go +++ b/src/internal/goexperiment/exp_arenas_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.arenas -// +build !goexperiment.arenas package goexperiment diff --git a/src/internal/goexperiment/exp_arenas_on.go b/src/internal/goexperiment/exp_arenas_on.go index 92ef748f629..609dfbca99f 100644 --- a/src/internal/goexperiment/exp_arenas_on.go +++ b/src/internal/goexperiment/exp_arenas_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.arenas -// +build goexperiment.arenas package goexperiment diff --git a/src/internal/goexperiment/exp_boringcrypto_off.go b/src/internal/goexperiment/exp_boringcrypto_off.go index 020c75bd532..de712670fd6 100644 --- a/src/internal/goexperiment/exp_boringcrypto_off.go +++ b/src/internal/goexperiment/exp_boringcrypto_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.boringcrypto -// +build !goexperiment.boringcrypto package goexperiment diff --git a/src/internal/goexperiment/exp_boringcrypto_on.go b/src/internal/goexperiment/exp_boringcrypto_on.go index 1454329a463..ce476faa057 100644 --- a/src/internal/goexperiment/exp_boringcrypto_on.go +++ b/src/internal/goexperiment/exp_boringcrypto_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.boringcrypto -// +build goexperiment.boringcrypto package goexperiment diff --git a/src/internal/goexperiment/exp_cacheprog_off.go b/src/internal/goexperiment/exp_cacheprog_off.go index 29aa8698238..276855c7d6f 100644 --- a/src/internal/goexperiment/exp_cacheprog_off.go +++ b/src/internal/goexperiment/exp_cacheprog_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.cacheprog -// +build !goexperiment.cacheprog package goexperiment diff --git a/src/internal/goexperiment/exp_cacheprog_on.go b/src/internal/goexperiment/exp_cacheprog_on.go index 121b299b00b..b959dd68b9f 100644 --- a/src/internal/goexperiment/exp_cacheprog_on.go +++ b/src/internal/goexperiment/exp_cacheprog_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.cacheprog -// +build goexperiment.cacheprog package goexperiment diff --git a/src/internal/goexperiment/exp_cgocheck2_off.go b/src/internal/goexperiment/exp_cgocheck2_off.go index 77aa5383090..e99ad078612 100644 --- a/src/internal/goexperiment/exp_cgocheck2_off.go +++ b/src/internal/goexperiment/exp_cgocheck2_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.cgocheck2 -// +build !goexperiment.cgocheck2 package goexperiment diff --git a/src/internal/goexperiment/exp_cgocheck2_on.go b/src/internal/goexperiment/exp_cgocheck2_on.go index 6201249ca57..f6d1790d4ca 100644 --- a/src/internal/goexperiment/exp_cgocheck2_on.go +++ b/src/internal/goexperiment/exp_cgocheck2_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.cgocheck2 -// +build goexperiment.cgocheck2 package goexperiment diff --git a/src/internal/goexperiment/exp_coverageredesign_off.go b/src/internal/goexperiment/exp_coverageredesign_off.go index 95d3a6c4aea..2c33177322d 100644 --- a/src/internal/goexperiment/exp_coverageredesign_off.go +++ b/src/internal/goexperiment/exp_coverageredesign_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.coverageredesign -// +build !goexperiment.coverageredesign package goexperiment diff --git a/src/internal/goexperiment/exp_coverageredesign_on.go b/src/internal/goexperiment/exp_coverageredesign_on.go index 330a234f20a..3fc6c2f70a9 100644 --- a/src/internal/goexperiment/exp_coverageredesign_on.go +++ b/src/internal/goexperiment/exp_coverageredesign_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.coverageredesign -// +build goexperiment.coverageredesign package goexperiment diff --git a/src/internal/goexperiment/exp_fieldtrack_off.go b/src/internal/goexperiment/exp_fieldtrack_off.go index e5e132660e1..ccced94cb0d 100644 --- a/src/internal/goexperiment/exp_fieldtrack_off.go +++ b/src/internal/goexperiment/exp_fieldtrack_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.fieldtrack -// +build !goexperiment.fieldtrack package goexperiment diff --git a/src/internal/goexperiment/exp_fieldtrack_on.go b/src/internal/goexperiment/exp_fieldtrack_on.go index 0d8c447246e..a49756750a3 100644 --- a/src/internal/goexperiment/exp_fieldtrack_on.go +++ b/src/internal/goexperiment/exp_fieldtrack_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.fieldtrack -// +build goexperiment.fieldtrack package goexperiment diff --git a/src/internal/goexperiment/exp_heapminimum512kib_off.go b/src/internal/goexperiment/exp_heapminimum512kib_off.go index 09da431b407..d67c5bb6747 100644 --- a/src/internal/goexperiment/exp_heapminimum512kib_off.go +++ b/src/internal/goexperiment/exp_heapminimum512kib_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.heapminimum512kib -// +build !goexperiment.heapminimum512kib package goexperiment diff --git a/src/internal/goexperiment/exp_heapminimum512kib_on.go b/src/internal/goexperiment/exp_heapminimum512kib_on.go index bab684b5e68..2d29c98e1b1 100644 --- a/src/internal/goexperiment/exp_heapminimum512kib_on.go +++ b/src/internal/goexperiment/exp_heapminimum512kib_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.heapminimum512kib -// +build goexperiment.heapminimum512kib package goexperiment diff --git a/src/internal/goexperiment/exp_loopvar_off.go b/src/internal/goexperiment/exp_loopvar_off.go index 1cd7ee15d75..cfede540526 100644 --- a/src/internal/goexperiment/exp_loopvar_off.go +++ b/src/internal/goexperiment/exp_loopvar_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.loopvar -// +build !goexperiment.loopvar package goexperiment diff --git a/src/internal/goexperiment/exp_loopvar_on.go b/src/internal/goexperiment/exp_loopvar_on.go index e3c8980c1ec..e158e0a666a 100644 --- a/src/internal/goexperiment/exp_loopvar_on.go +++ b/src/internal/goexperiment/exp_loopvar_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.loopvar -// +build goexperiment.loopvar package goexperiment diff --git a/src/internal/goexperiment/exp_newinliner_off.go b/src/internal/goexperiment/exp_newinliner_off.go index 307c651b7a1..d94e736528f 100644 --- a/src/internal/goexperiment/exp_newinliner_off.go +++ b/src/internal/goexperiment/exp_newinliner_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.newinliner -// +build !goexperiment.newinliner package goexperiment diff --git a/src/internal/goexperiment/exp_newinliner_on.go b/src/internal/goexperiment/exp_newinliner_on.go index 59f400ff579..6777dbc0487 100644 --- a/src/internal/goexperiment/exp_newinliner_on.go +++ b/src/internal/goexperiment/exp_newinliner_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.newinliner -// +build goexperiment.newinliner package goexperiment diff --git a/src/internal/goexperiment/exp_pagetrace_off.go b/src/internal/goexperiment/exp_pagetrace_off.go index 789e88332dc..142be47d963 100644 --- a/src/internal/goexperiment/exp_pagetrace_off.go +++ b/src/internal/goexperiment/exp_pagetrace_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.pagetrace -// +build !goexperiment.pagetrace package goexperiment diff --git a/src/internal/goexperiment/exp_pagetrace_on.go b/src/internal/goexperiment/exp_pagetrace_on.go index ea72b54863d..f3b16147890 100644 --- a/src/internal/goexperiment/exp_pagetrace_on.go +++ b/src/internal/goexperiment/exp_pagetrace_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.pagetrace -// +build goexperiment.pagetrace package goexperiment diff --git a/src/internal/goexperiment/exp_preemptibleloops_off.go b/src/internal/goexperiment/exp_preemptibleloops_off.go index 7a26088e809..cddcc1b8cc2 100644 --- a/src/internal/goexperiment/exp_preemptibleloops_off.go +++ b/src/internal/goexperiment/exp_preemptibleloops_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.preemptibleloops -// +build !goexperiment.preemptibleloops package goexperiment diff --git a/src/internal/goexperiment/exp_preemptibleloops_on.go b/src/internal/goexperiment/exp_preemptibleloops_on.go index a9ca28c57cf..7f474c03577 100644 --- a/src/internal/goexperiment/exp_preemptibleloops_on.go +++ b/src/internal/goexperiment/exp_preemptibleloops_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.preemptibleloops -// +build goexperiment.preemptibleloops package goexperiment diff --git a/src/internal/goexperiment/exp_range_off.go b/src/internal/goexperiment/exp_range_off.go index 4afb988ea7e..82f5dc71b28 100644 --- a/src/internal/goexperiment/exp_range_off.go +++ b/src/internal/goexperiment/exp_range_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.range -// +build !goexperiment.range package goexperiment diff --git a/src/internal/goexperiment/exp_range_on.go b/src/internal/goexperiment/exp_range_on.go index 67317593d3d..1d0f30f49f8 100644 --- a/src/internal/goexperiment/exp_range_on.go +++ b/src/internal/goexperiment/exp_range_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.range -// +build goexperiment.range package goexperiment diff --git a/src/internal/goexperiment/exp_regabiargs_off.go b/src/internal/goexperiment/exp_regabiargs_off.go index 31a139bbf19..a8c8536fa01 100644 --- a/src/internal/goexperiment/exp_regabiargs_off.go +++ b/src/internal/goexperiment/exp_regabiargs_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.regabiargs -// +build !goexperiment.regabiargs package goexperiment diff --git a/src/internal/goexperiment/exp_regabiargs_on.go b/src/internal/goexperiment/exp_regabiargs_on.go index 9b26f3c9cb2..def3b940047 100644 --- a/src/internal/goexperiment/exp_regabiargs_on.go +++ b/src/internal/goexperiment/exp_regabiargs_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.regabiargs -// +build goexperiment.regabiargs package goexperiment diff --git a/src/internal/goexperiment/exp_regabiwrappers_off.go b/src/internal/goexperiment/exp_regabiwrappers_off.go index bfa0fa37798..a65ed3649d6 100644 --- a/src/internal/goexperiment/exp_regabiwrappers_off.go +++ b/src/internal/goexperiment/exp_regabiwrappers_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.regabiwrappers -// +build !goexperiment.regabiwrappers package goexperiment diff --git a/src/internal/goexperiment/exp_regabiwrappers_on.go b/src/internal/goexperiment/exp_regabiwrappers_on.go index 11ffffbbff6..d525c9a86d1 100644 --- a/src/internal/goexperiment/exp_regabiwrappers_on.go +++ b/src/internal/goexperiment/exp_regabiwrappers_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.regabiwrappers -// +build goexperiment.regabiwrappers package goexperiment diff --git a/src/internal/goexperiment/exp_staticlockranking_off.go b/src/internal/goexperiment/exp_staticlockranking_off.go index 3d546c04b40..5fafff2591c 100644 --- a/src/internal/goexperiment/exp_staticlockranking_off.go +++ b/src/internal/goexperiment/exp_staticlockranking_off.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build !goexperiment.staticlockranking -// +build !goexperiment.staticlockranking package goexperiment diff --git a/src/internal/goexperiment/exp_staticlockranking_on.go b/src/internal/goexperiment/exp_staticlockranking_on.go index 78188fb810c..dfd32a8ad9c 100644 --- a/src/internal/goexperiment/exp_staticlockranking_on.go +++ b/src/internal/goexperiment/exp_staticlockranking_on.go @@ -1,7 +1,6 @@ // Code generated by mkconsts.go. DO NOT EDIT. //go:build goexperiment.staticlockranking -// +build goexperiment.staticlockranking package goexperiment diff --git a/src/internal/goexperiment/mkconsts.go b/src/internal/goexperiment/mkconsts.go index 204ca9d9aa4..65c100fa3a6 100644 --- a/src/internal/goexperiment/mkconsts.go +++ b/src/internal/goexperiment/mkconsts.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // mkconsts generates const definition files for each GOEXPERIMENT. package main @@ -52,13 +51,12 @@ func main() { data := fmt.Sprintf(`// Code generated by mkconsts.go. DO NOT EDIT. //go:build %s%s -// +build %s%s package goexperiment const %s = %v const %sInt = %s -`, pick(val, "!", ""), buildTag, pick(val, "!", ""), buildTag, f, val, f, pick(val, "0", "1")) +`, pick(val, "!", ""), buildTag, f, val, f, pick(val, "0", "1")) if err := os.WriteFile(name, []byte(data), 0666); err != nil { log.Fatalf("writing %s: %v", name, err) } diff --git a/src/internal/race/norace.go b/src/internal/race/norace.go index 67b13057131..da650489fc4 100644 --- a/src/internal/race/norace.go +++ b/src/internal/race/norace.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !race -// +build !race package race diff --git a/src/internal/race/race.go b/src/internal/race/race.go index 40f2c99383f..d2c7e53e418 100644 --- a/src/internal/race/race.go +++ b/src/internal/race/race.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build race -// +build race package race diff --git a/src/math/big/arith_386.s b/src/math/big/arith_386.s index 8cf4665f29c..90f6a8c70e1 100644 --- a/src/math/big/arith_386.s +++ b/src/math/big/arith_386.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go #include "textflag.h" diff --git a/src/math/big/arith_amd64.go b/src/math/big/arith_amd64.go index 89108fe1492..3db72582bbc 100644 --- a/src/math/big/arith_amd64.go +++ b/src/math/big/arith_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go package big diff --git a/src/math/big/arith_amd64.s b/src/math/big/arith_amd64.s index b1e914c2bdc..a5b65b1d3c7 100644 --- a/src/math/big/arith_amd64.s +++ b/src/math/big/arith_amd64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go #include "textflag.h" diff --git a/src/math/big/arith_arm.s b/src/math/big/arith_arm.s index 10054bde474..ece3a96f512 100644 --- a/src/math/big/arith_arm.s +++ b/src/math/big/arith_arm.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go #include "textflag.h" diff --git a/src/math/big/arith_arm64.s b/src/math/big/arith_arm64.s index addf2d64a18..204006e01dc 100644 --- a/src/math/big/arith_arm64.s +++ b/src/math/big/arith_arm64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go #include "textflag.h" diff --git a/src/math/big/arith_decl.go b/src/math/big/arith_decl.go index 9b254f22130..f14f8d6794e 100644 --- a/src/math/big/arith_decl.go +++ b/src/math/big/arith_decl.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go package big diff --git a/src/math/big/arith_decl_pure.go b/src/math/big/arith_decl_pure.go index 75f3ed29486..4d7bbc87716 100644 --- a/src/math/big/arith_decl_pure.go +++ b/src/math/big/arith_decl_pure.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build math_big_pure_go -// +build math_big_pure_go package big diff --git a/src/math/big/arith_decl_s390x.go b/src/math/big/arith_decl_s390x.go index 4193f3231cb..65391668781 100644 --- a/src/math/big/arith_decl_s390x.go +++ b/src/math/big/arith_decl_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go package big diff --git a/src/math/big/arith_loong64.s b/src/math/big/arith_loong64.s index 0ae30319672..847e3127fbf 100644 --- a/src/math/big/arith_loong64.s +++ b/src/math/big/arith_loong64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !math_big_pure_go,loong64 +//go:build !math_big_pure_go && loong64 #include "textflag.h" diff --git a/src/math/big/arith_mips64x.s b/src/math/big/arith_mips64x.s index 3ee6e27c823..393a3efb9bc 100644 --- a/src/math/big/arith_mips64x.s +++ b/src/math/big/arith_mips64x.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go && (mips64 || mips64le) -// +build !math_big_pure_go -// +build mips64 mips64le #include "textflag.h" diff --git a/src/math/big/arith_mipsx.s b/src/math/big/arith_mipsx.s index b1d32821afd..cdb4bbcab63 100644 --- a/src/math/big/arith_mipsx.s +++ b/src/math/big/arith_mipsx.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go && (mips || mipsle) -// +build !math_big_pure_go -// +build mips mipsle #include "textflag.h" diff --git a/src/math/big/arith_ppc64x.s b/src/math/big/arith_ppc64x.s index 0613f5c3ad0..9512a12270d 100644 --- a/src/math/big/arith_ppc64x.s +++ b/src/math/big/arith_ppc64x.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go && (ppc64 || ppc64le) -// +build !math_big_pure_go -// +build ppc64 ppc64le #include "textflag.h" diff --git a/src/math/big/arith_riscv64.s b/src/math/big/arith_riscv64.s index cb9ac182927..bad32497b71 100644 --- a/src/math/big/arith_riscv64.s +++ b/src/math/big/arith_riscv64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go && riscv64 -// +build !math_big_pure_go,riscv64 #include "textflag.h" diff --git a/src/math/big/arith_s390x.s b/src/math/big/arith_s390x.s index aa6590e20a5..01a7bb2d512 100644 --- a/src/math/big/arith_s390x.s +++ b/src/math/big/arith_s390x.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go #include "textflag.h" diff --git a/src/math/big/arith_s390x_test.go b/src/math/big/arith_s390x_test.go index 093984b397e..0b91cc1393f 100644 --- a/src/math/big/arith_s390x_test.go +++ b/src/math/big/arith_s390x_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build s390x && !math_big_pure_go -// +build s390x,!math_big_pure_go package big diff --git a/src/math/big/arith_wasm.s b/src/math/big/arith_wasm.s index 93eb16d21d8..fd51031d8a0 100644 --- a/src/math/big/arith_wasm.s +++ b/src/math/big/arith_wasm.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !math_big_pure_go -// +build !math_big_pure_go #include "textflag.h" diff --git a/src/math/bits/bits_errors.go b/src/math/bits/bits_errors.go index 61cb5c94570..353d2f6ad3a 100644 --- a/src/math/bits/bits_errors.go +++ b/src/math/bits/bits_errors.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !compiler_bootstrap -// +build !compiler_bootstrap package bits diff --git a/src/math/bits/bits_errors_bootstrap.go b/src/math/bits/bits_errors_bootstrap.go index 4d610d33b8b..6b14e41f83c 100644 --- a/src/math/bits/bits_errors_bootstrap.go +++ b/src/math/bits/bits_errors_bootstrap.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build compiler_bootstrap -// +build compiler_bootstrap // This version used only for bootstrap (on this path we want // to avoid use of go:linkname as applied to variables). diff --git a/src/math/bits/make_examples.go b/src/math/bits/make_examples.go index 92e9aabfb52..4bd7f581479 100644 --- a/src/math/bits/make_examples.go +++ b/src/math/bits/make_examples.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // This program generates example_test.go. diff --git a/src/math/bits/make_tables.go b/src/math/bits/make_tables.go index 867025ea61d..d067361a123 100644 --- a/src/math/bits/make_tables.go +++ b/src/math/bits/make_tables.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // This program generates bits_tables.go. diff --git a/src/math/floor_ppc64x.s b/src/math/floor_ppc64x.s index 584c27e28f6..e9c5d49f4a5 100644 --- a/src/math/floor_ppc64x.s +++ b/src/math/floor_ppc64x.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ppc64 || ppc64le -// +build ppc64 ppc64le #include "textflag.h" diff --git a/src/math/modf_ppc64x.s b/src/math/modf_ppc64x.s index 1303067661c..410b523c0e8 100644 --- a/src/math/modf_ppc64x.s +++ b/src/math/modf_ppc64x.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ppc64 || ppc64le -// +build ppc64 ppc64le #include "textflag.h" diff --git a/src/net/http/h2_error.go b/src/net/http/h2_error.go index 0391d31e5b4..2c0b21ec070 100644 --- a/src/net/http/h2_error.go +++ b/src/net/http/h2_error.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !nethttpomithttp2 -// +build !nethttpomithttp2 package http diff --git a/src/net/http/h2_error_test.go b/src/net/http/h2_error_test.go index 0d85e2f36c3..5e400683b41 100644 --- a/src/net/http/h2_error_test.go +++ b/src/net/http/h2_error_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !nethttpomithttp2 -// +build !nethttpomithttp2 package http diff --git a/src/net/sendfile_linux_test.go b/src/net/sendfile_linux_test.go index 8cd6acca17c..0b5af36cdb7 100644 --- a/src/net/sendfile_linux_test.go +++ b/src/net/sendfile_linux_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux -// +build linux package net diff --git a/src/runtime/internal/atomic/atomic_andor_test.go b/src/runtime/internal/atomic/atomic_andor_test.go index a1918e3ecfa..03c2c754f33 100644 --- a/src/runtime/internal/atomic/atomic_andor_test.go +++ b/src/runtime/internal/atomic/atomic_andor_test.go @@ -1,5 +1,4 @@ //go:build wasm || ppc64 || ppc64le -// +build wasm ppc64 ppc64le // // Copyright 2023 The Go Authors. All rights reserved. diff --git a/src/runtime/race_s390x.s b/src/runtime/race_s390x.s index beb7f830f22..dadc12f4dbf 100644 --- a/src/runtime/race_s390x.s +++ b/src/runtime/race_s390x.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build race -// +build race #include "go_asm.h" #include "funcdata.h" diff --git a/src/runtime/vdso_linux_s390x.go b/src/runtime/vdso_linux_s390x.go index c1c0b1baa47..970ecd3ce63 100644 --- a/src/runtime/vdso_linux_s390x.go +++ b/src/runtime/vdso_linux_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && s390x -// +build linux,s390x package runtime diff --git a/src/sort/gen_sort_variants.go b/src/sort/gen_sort_variants.go index 89500e1c10f..95fca709878 100644 --- a/src/sort/gen_sort_variants.go +++ b/src/sort/gen_sort_variants.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // This program is run via "go generate" (via a directive in sort.go) // to generate implementation variants of the underlying sorting algorithm. diff --git a/src/strconv/bytealg.go b/src/strconv/bytealg.go index a2bb12c5f21..6fe1624c0e7 100644 --- a/src/strconv/bytealg.go +++ b/src/strconv/bytealg.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !compiler_bootstrap -// +build !compiler_bootstrap package strconv diff --git a/src/strconv/bytealg_bootstrap.go b/src/strconv/bytealg_bootstrap.go index 0ed79f4de7a..12d96e5b531 100644 --- a/src/strconv/bytealg_bootstrap.go +++ b/src/strconv/bytealg_bootstrap.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build compiler_bootstrap -// +build compiler_bootstrap package strconv diff --git a/src/strconv/makeisprint.go b/src/strconv/makeisprint.go index 909f9e47878..ff361e7b41f 100644 --- a/src/strconv/makeisprint.go +++ b/src/strconv/makeisprint.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore // // usage: -- GitLab