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>
This commit is contained in:
Dmitri Shuralyov 2023-10-17 15:19:33 -04:00 committed by Gopher Robot
parent b2fd76ab8d
commit bf97e724b5
89 changed files with 6 additions and 96 deletions

View File

@ -12,7 +12,7 @@
# regular 'go run .' usage to run the generator.
cat >main_test.go <<-EOF
// +build ignore
//go:build ignore
package main

View File

@ -7,7 +7,6 @@
// to avoid depending on having a working compiler binary.
//go:build ignore
// +build ignore
package coverage

View File

@ -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

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !windows
// +build !windows
package main

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build gc
// +build gc
package main

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build gccgo
// +build gccgo
package main

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build gc
// +build gc
#include "textflag.h"

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build gc && !arm
// +build gc,!arm
#include "textflag.h"

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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.
//

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !purego
// +build !purego
package notsha256

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !purego
// +build !purego
#include "textflag.h"

View File

@ -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

View File

@ -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

View File

@ -9,8 +9,6 @@
//
//go:build !purego && (ppc64 || ppc64le)
// +build !purego
// +build ppc64 ppc64le
// Based on CRYPTOGAMS code with the following comment:
// # ====================================================================

View File

@ -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.

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build cgo
// +build cgo
package ld

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !wasm && !windows
// +build !wasm,!windows
package ld

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build wasm || windows
// +build wasm windows
package ld

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.arenas
// +build !goexperiment.arenas
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.arenas
// +build goexperiment.arenas
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.boringcrypto
// +build !goexperiment.boringcrypto
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.boringcrypto
// +build goexperiment.boringcrypto
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.cacheprog
// +build !goexperiment.cacheprog
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.cacheprog
// +build goexperiment.cacheprog
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.cgocheck2
// +build !goexperiment.cgocheck2
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.cgocheck2
// +build goexperiment.cgocheck2
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.coverageredesign
// +build !goexperiment.coverageredesign
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.coverageredesign
// +build goexperiment.coverageredesign
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.fieldtrack
// +build !goexperiment.fieldtrack
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.fieldtrack
// +build goexperiment.fieldtrack
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.heapminimum512kib
// +build !goexperiment.heapminimum512kib
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.heapminimum512kib
// +build goexperiment.heapminimum512kib
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.loopvar
// +build !goexperiment.loopvar
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.loopvar
// +build goexperiment.loopvar
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.newinliner
// +build !goexperiment.newinliner
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.newinliner
// +build goexperiment.newinliner
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.pagetrace
// +build !goexperiment.pagetrace
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.pagetrace
// +build goexperiment.pagetrace
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.preemptibleloops
// +build !goexperiment.preemptibleloops
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.preemptibleloops
// +build goexperiment.preemptibleloops
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.range
// +build !goexperiment.range
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.range
// +build goexperiment.range
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.regabiargs
// +build !goexperiment.regabiargs
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.regabiargs
// +build goexperiment.regabiargs
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.regabiwrappers
// +build !goexperiment.regabiwrappers
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.regabiwrappers
// +build goexperiment.regabiwrappers
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.staticlockranking
// +build !goexperiment.staticlockranking
package goexperiment

View File

@ -1,7 +1,6 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.staticlockranking
// +build goexperiment.staticlockranking
package goexperiment

View File

@ -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)
}

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !race
// +build !race
package race

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build race
// +build race
package race

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !compiler_bootstrap
// +build !compiler_bootstrap
package bits

View File

@ -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).

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
// This program generates example_test.go.

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
// This program generates bits_tables.go.

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ppc64 || ppc64le
// +build ppc64 ppc64le
#include "textflag.h"

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ppc64 || ppc64le
// +build ppc64 ppc64le
#include "textflag.h"

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !nethttpomithttp2
// +build !nethttpomithttp2
package http

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !nethttpomithttp2
// +build !nethttpomithttp2
package http

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build linux
// +build linux
package net

View File

@ -1,5 +1,4 @@
//go:build wasm || ppc64 || ppc64le
// +build wasm ppc64 ppc64le
//
// Copyright 2023 The Go Authors. All rights reserved.

View File

@ -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"

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build linux && s390x
// +build linux,s390x
package runtime

View File

@ -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.

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !compiler_bootstrap
// +build !compiler_bootstrap
package strconv

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build compiler_bootstrap
// +build compiler_bootstrap
package strconv

View File

@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
//
// usage: