Skip to content

Commit

Permalink
all: manual fixups for //go:build vs // +build
Browse files Browse the repository at this point in the history
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 <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
  • Loading branch information
rsc committed Oct 28, 2021
1 parent d0751b1 commit af05d8b
Show file tree
Hide file tree
Showing 21 changed files with 1 addition and 27 deletions.
1 change: 0 additions & 1 deletion src/crypto/elliptic/gen_p256_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func main() {
// Generated by gen_p256_table.go. DO NOT EDIT.
//go:build amd64 || arm64
// +build amd64 arm64
package elliptic
Expand Down
3 changes: 1 addition & 2 deletions src/internal/goarch/gengoarch.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func main() {
}
var buf bytes.Buffer
fmt.Fprintf(&buf, "// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.\n\n")
fmt.Fprintf(&buf, "//go:build %s\n", target)
fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
fmt.Fprintf(&buf, "//go:build %s\n", target) // must explicitly include target for bootstrapping purposes
fmt.Fprintf(&buf, "package goarch\n\n")
fmt.Fprintf(&buf, "const GOARCH = `%s`\n\n", target)
for _, goarch := range goarches {
Expand Down
1 change: 0 additions & 1 deletion src/internal/goos/gengoos.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func main() {
var buf bytes.Buffer
fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
fmt.Fprintf(&buf, "//go:build %s\n", strings.Join(tags, " && "))
fmt.Fprintf(&buf, "// +build %s\n\n", strings.Join(tags, ","))
fmt.Fprintf(&buf, "package goos\n\n")
fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target)
for _, goos := range gooses {
Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/exec_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

package windows_test

Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/mksyscall.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build generate
// +build generate

package windows

Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/registry/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

package registry

Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/registry/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

// Package registry provides access to the Windows registry.
//
Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/registry/mksyscall.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build generate
// +build generate

package registry

Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

package registry_test

Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/registry/syscall.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

package registry

Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/registry/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

package registry

Expand Down
1 change: 0 additions & 1 deletion src/internal/syscall/windows/sysdll/sysdll.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

// Package sysdll is an internal leaf package that records and reports
// which Windows DLL names are used by Go itself. These DLLs are then
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/asan/asan.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// license that can be found in the LICENSE file.

//go:build asan && linux && (arm64 || amd64)
// +build asan
// +build linux
// +build arm64 amd64

package asan

Expand Down
2 changes: 0 additions & 2 deletions src/runtime/mkduff.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func copyARM64(w io.Writer) {
func tagsPPC64x(w io.Writer) {
fmt.Fprintln(w)
fmt.Fprintln(w, "//go:build ppc64 || ppc64le")
fmt.Fprintln(w, "// +build ppc64 ppc64le")
fmt.Fprintln(w)
}

Expand Down Expand Up @@ -207,7 +206,6 @@ func copyPPC64x(w io.Writer) {
func tagsMIPS64x(w io.Writer) {
fmt.Fprintln(w)
fmt.Fprintln(w, "//go:build mips64 || mips64le")
fmt.Fprintln(w, "// +build mips64 mips64le")
fmt.Fprintln(w)
}

Expand Down
1 change: 0 additions & 1 deletion src/runtime/mkpreempt.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func header(arch string) {
if beLe[arch] {
base := arch[:len(arch)-1]
fmt.Fprintf(out, "//go:build %s || %sle\n", base, base)
fmt.Fprintf(out, "// +build %s %sle\n\n", base, base)
}
fmt.Fprintf(out, "#include \"go_asm.h\"\n")
fmt.Fprintf(out, "#include \"textflag.h\"\n\n")
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/msan/msan.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// license that can be found in the LICENSE file.

//go:build msan && linux && (amd64 || arm64)
// +build msan
// +build linux
// +build amd64 arm64

package msan

Expand Down
1 change: 0 additions & 1 deletion src/runtime/wincallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func genasm386Amd64() {
buf.WriteString(`// Code generated by wincallback.go using 'go generate'. DO NOT EDIT.
//go:build 386 || amd64
// +build 386 amd64
// runtime·callbackasm is called by external code to
// execute Go implemented callback function. It is not
Expand Down
1 change: 0 additions & 1 deletion src/syscall/js/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build js && wasm
// +build js,wasm

package js

Expand Down
1 change: 0 additions & 1 deletion src/syscall/js/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build js && wasm
// +build js,wasm

package js

Expand Down
1 change: 0 additions & 1 deletion src/syscall/js/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build js && wasm
// +build js,wasm

// Package js gives access to the WebAssembly host environment when using the js/wasm architecture.
// Its API is based on JavaScript semantics.
Expand Down
1 change: 0 additions & 1 deletion src/syscall/js/js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build js && wasm
// +build js,wasm

// To run these tests:
//
Expand Down

0 comments on commit af05d8b

Please sign in to comment.