Skip to content

Commit af05d8b

Browse files
committed
all: manual fixups for //go:build vs // +build
Update many generators, also handle files that were not part of the standard build during 'go fix' in CL 344955. Fixes #41184. Change-Id: I1edc684e8101882dcd11f75c6745c266fccfe9e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/359476 Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent d0751b1 commit af05d8b

21 files changed

+1
-27
lines changed

src/crypto/elliptic/gen_p256_table.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ func main() {
2626
// Generated by gen_p256_table.go. DO NOT EDIT.
2727
2828
//go:build amd64 || arm64
29-
// +build amd64 arm64
3029
3130
package elliptic
3231

src/internal/goarch/gengoarch.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ func main() {
3939
}
4040
var buf bytes.Buffer
4141
fmt.Fprintf(&buf, "// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.\n\n")
42-
fmt.Fprintf(&buf, "//go:build %s\n", target)
43-
fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
42+
fmt.Fprintf(&buf, "//go:build %s\n", target) // must explicitly include target for bootstrapping purposes
4443
fmt.Fprintf(&buf, "package goarch\n\n")
4544
fmt.Fprintf(&buf, "const GOARCH = `%s`\n\n", target)
4645
for _, goarch := range goarches {

src/internal/goos/gengoos.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ func main() {
5151
var buf bytes.Buffer
5252
fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
5353
fmt.Fprintf(&buf, "//go:build %s\n", strings.Join(tags, " && "))
54-
fmt.Fprintf(&buf, "// +build %s\n\n", strings.Join(tags, ","))
5554
fmt.Fprintf(&buf, "package goos\n\n")
5655
fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target)
5756
for _, goos := range gooses {

src/internal/syscall/windows/exec_windows_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build windows
6-
// +build windows
76

87
package windows_test
98

src/internal/syscall/windows/mksyscall.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build generate
6-
// +build generate
76

87
package windows
98

src/internal/syscall/windows/registry/export_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build windows
6-
// +build windows
76

87
package registry
98

src/internal/syscall/windows/registry/key.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build windows
6-
// +build windows
76

87
// Package registry provides access to the Windows registry.
98
//

src/internal/syscall/windows/registry/mksyscall.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build generate
6-
// +build generate
76

87
package registry
98

src/internal/syscall/windows/registry/registry_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build windows
6-
// +build windows
76

87
package registry_test
98

src/internal/syscall/windows/registry/syscall.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build windows
6-
// +build windows
76

87
package registry
98

src/internal/syscall/windows/registry/value.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build windows
6-
// +build windows
76

87
package registry
98

src/internal/syscall/windows/sysdll/sysdll.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build windows
6-
// +build windows
76

87
// Package sysdll is an internal leaf package that records and reports
98
// which Windows DLL names are used by Go itself. These DLLs are then

src/runtime/asan/asan.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build asan && linux && (arm64 || amd64)
6-
// +build asan
7-
// +build linux
8-
// +build arm64 amd64
96

107
package asan
118

src/runtime/mkduff.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ func copyARM64(w io.Writer) {
179179
func tagsPPC64x(w io.Writer) {
180180
fmt.Fprintln(w)
181181
fmt.Fprintln(w, "//go:build ppc64 || ppc64le")
182-
fmt.Fprintln(w, "// +build ppc64 ppc64le")
183182
fmt.Fprintln(w)
184183
}
185184

@@ -207,7 +206,6 @@ func copyPPC64x(w io.Writer) {
207206
func tagsMIPS64x(w io.Writer) {
208207
fmt.Fprintln(w)
209208
fmt.Fprintln(w, "//go:build mips64 || mips64le")
210-
fmt.Fprintln(w, "// +build mips64 mips64le")
211209
fmt.Fprintln(w)
212210
}
213211

src/runtime/mkpreempt.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ func header(arch string) {
123123
if beLe[arch] {
124124
base := arch[:len(arch)-1]
125125
fmt.Fprintf(out, "//go:build %s || %sle\n", base, base)
126-
fmt.Fprintf(out, "// +build %s %sle\n\n", base, base)
127126
}
128127
fmt.Fprintf(out, "#include \"go_asm.h\"\n")
129128
fmt.Fprintf(out, "#include \"textflag.h\"\n\n")

src/runtime/msan/msan.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build msan && linux && (amd64 || arm64)
6-
// +build msan
7-
// +build linux
8-
// +build amd64 arm64
96

107
package msan
118

src/runtime/wincallback.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ func genasm386Amd64() {
2222
buf.WriteString(`// Code generated by wincallback.go using 'go generate'. DO NOT EDIT.
2323
2424
//go:build 386 || amd64
25-
// +build 386 amd64
2625
2726
// runtime·callbackasm is called by external code to
2827
// execute Go implemented callback function. It is not

src/syscall/js/export_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build js && wasm
6-
// +build js,wasm
76

87
package js
98

src/syscall/js/func.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build js && wasm
6-
// +build js,wasm
76

87
package js
98

src/syscall/js/js.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build js && wasm
6-
// +build js,wasm
76

87
// Package js gives access to the WebAssembly host environment when using the js/wasm architecture.
98
// Its API is based on JavaScript semantics.

src/syscall/js/js_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build js && wasm
6-
// +build js,wasm
76

87
// To run these tests:
98
//

0 commit comments

Comments
 (0)