aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-02-19 18:35:10 -0500
committerRuss Cox <rsc@golang.org>2021-02-20 03:54:50 +0000
commitd4b26382342c98a95b85140b2863bc30c48edd68 (patch)
tree6ef0d77cc69a5a99a90fb528d083f6aca7448667 /src/runtime
parent0625460f79eed41039939f957baceaff5e269672 (diff)
downloadgo-d4b26382342c98a95b85140b2863bc30c48edd68.tar.gz
go-d4b26382342c98a95b85140b2863bc30c48edd68.zip
all: go fmt std cmd (but revert vendor)
Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/auxv_none.go8
-rw-r--r--src/runtime/cgo/callbacks_traceback.go1
-rw-r--r--src/runtime/cgo/dragonfly.go1
-rw-r--r--src/runtime/cgo/freebsd.go1
-rw-r--r--src/runtime/cgo/linux.go1
-rw-r--r--src/runtime/cgo/mmap.go1
-rw-r--r--src/runtime/cgo/netbsd.go1
-rw-r--r--src/runtime/cgo/openbsd.go1
-rw-r--r--src/runtime/cgo/setenv.go1
-rw-r--r--src/runtime/cgo/sigaction.go1
-rw-r--r--src/runtime/cgo_mmap.go1
-rw-r--r--src/runtime/cgo_ppc64x.go1
-rw-r--r--src/runtime/cgo_sigaction.go1
-rw-r--r--src/runtime/cputicks.go9
-rw-r--r--src/runtime/crash_cgo_test.go1
-rw-r--r--src/runtime/crash_nonunix_test.go1
-rw-r--r--src/runtime/crash_unix_test.go1
-rw-r--r--src/runtime/debug/panic_test.go1
-rw-r--r--src/runtime/debug_test.go5
-rw-r--r--src/runtime/debugcall.go1
-rw-r--r--src/runtime/debuglog_off.go1
-rw-r--r--src/runtime/debuglog_on.go1
-rw-r--r--src/runtime/defs1_linux.go1
-rw-r--r--src/runtime/defs2_linux.go1
-rw-r--r--src/runtime/defs3_linux.go1
-rw-r--r--src/runtime/defs_aix.go1
-rw-r--r--src/runtime/defs_aix_ppc64.go1
-rw-r--r--src/runtime/defs_arm_linux.go1
-rw-r--r--src/runtime/defs_darwin.go1
-rw-r--r--src/runtime/defs_dragonfly.go1
-rw-r--r--src/runtime/defs_freebsd.go1
-rw-r--r--src/runtime/defs_linux.go1
-rw-r--r--src/runtime/defs_linux_mips64x.go1
-rw-r--r--src/runtime/defs_linux_mipsx.go1
-rw-r--r--src/runtime/defs_netbsd.go1
-rw-r--r--src/runtime/defs_netbsd_386.go1
-rw-r--r--src/runtime/defs_netbsd_amd64.go1
-rw-r--r--src/runtime/defs_netbsd_arm.go1
-rw-r--r--src/runtime/defs_openbsd.go1
-rw-r--r--src/runtime/defs_solaris.go1
-rw-r--r--src/runtime/defs_solaris_amd64.go1
-rw-r--r--src/runtime/env_posix.go1
-rw-r--r--src/runtime/export_debug_test.go4
-rw-r--r--src/runtime/export_futex_test.go1
-rw-r--r--src/runtime/export_mmap_test.go1
-rw-r--r--src/runtime/export_pipe2_test.go1
-rw-r--r--src/runtime/export_pipe_test.go1
-rw-r--r--src/runtime/export_unix_test.go1
-rw-r--r--src/runtime/futex_test.go1
-rw-r--r--src/runtime/hash32.go1
-rw-r--r--src/runtime/hash64.go1
-rw-r--r--src/runtime/internal/atomic/atomic_386.go1
-rw-r--r--src/runtime/internal/atomic/atomic_arm.go1
-rw-r--r--src/runtime/internal/atomic/atomic_arm64.go1
-rw-r--r--src/runtime/internal/atomic/atomic_mips64x.go1
-rw-r--r--src/runtime/internal/atomic/atomic_mipsx.go1
-rw-r--r--src/runtime/internal/atomic/atomic_ppc64x.go1
-rw-r--r--src/runtime/internal/atomic/stubs.go1
-rw-r--r--src/runtime/internal/sys/gengoos.go1
-rw-r--r--src/runtime/internal/sys/intrinsics.go1
-rw-r--r--src/runtime/internal/sys/intrinsics_stubs.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_386.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_amd64.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_arm.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_arm64.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_arm64be.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_armbe.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_mips.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_mips64.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_mips64le.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_mips64p32.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_mips64p32le.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_mipsle.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_ppc.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_ppc64.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_ppc64le.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_riscv.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_riscv64.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_s390.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_s390x.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_sparc.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_sparc64.go1
-rw-r--r--src/runtime/internal/sys/zgoarch_wasm.go1
-rw-r--r--src/runtime/internal/sys/zgoos_aix.go1
-rw-r--r--src/runtime/internal/sys/zgoos_android.go1
-rw-r--r--src/runtime/internal/sys/zgoos_darwin.go4
-rw-r--r--src/runtime/internal/sys/zgoos_dragonfly.go1
-rw-r--r--src/runtime/internal/sys/zgoos_freebsd.go1
-rw-r--r--src/runtime/internal/sys/zgoos_hurd.go1
-rw-r--r--src/runtime/internal/sys/zgoos_illumos.go1
-rw-r--r--src/runtime/internal/sys/zgoos_ios.go1
-rw-r--r--src/runtime/internal/sys/zgoos_js.go1
-rw-r--r--src/runtime/internal/sys/zgoos_linux.go4
-rw-r--r--src/runtime/internal/sys/zgoos_netbsd.go1
-rw-r--r--src/runtime/internal/sys/zgoos_openbsd.go1
-rw-r--r--src/runtime/internal/sys/zgoos_plan9.go1
-rw-r--r--src/runtime/internal/sys/zgoos_solaris.go4
-rw-r--r--src/runtime/internal/sys/zgoos_windows.go1
-rw-r--r--src/runtime/internal/sys/zgoos_zos.go1
-rw-r--r--src/runtime/lfstack_32bit.go1
-rw-r--r--src/runtime/lfstack_64bit.go1
-rw-r--r--src/runtime/libfuzzer.go1
-rw-r--r--src/runtime/lock_futex.go1
-rw-r--r--src/runtime/lock_js.go1
-rw-r--r--src/runtime/lock_sema.go1
-rw-r--r--src/runtime/lockrank_off.go1
-rw-r--r--src/runtime/lockrank_on.go1
-rw-r--r--src/runtime/mem_bsd.go1
-rw-r--r--src/runtime/mem_js.go1
-rw-r--r--src/runtime/mkduff.go1
-rw-r--r--src/runtime/mkfastlog2table.go1
-rw-r--r--src/runtime/mkpreempt.go1
-rw-r--r--src/runtime/mksizeclasses.go1
-rw-r--r--src/runtime/mmap.go1
-rw-r--r--src/runtime/mpagealloc_32bit.go1
-rw-r--r--src/runtime/mpagealloc_64bit.go1
-rw-r--r--src/runtime/msan.go1
-rw-r--r--src/runtime/msan0.go1
-rw-r--r--src/runtime/nbpipe_fcntl_libc_test.go1
-rw-r--r--src/runtime/nbpipe_fcntl_unix_test.go1
-rw-r--r--src/runtime/nbpipe_pipe.go1
-rw-r--r--src/runtime/nbpipe_pipe2.go1
-rw-r--r--src/runtime/nbpipe_test.go1
-rw-r--r--src/runtime/netpoll.go1
-rw-r--r--src/runtime/netpoll_epoll.go1
-rw-r--r--src/runtime/netpoll_fake.go1
-rw-r--r--src/runtime/netpoll_kqueue.go1
-rw-r--r--src/runtime/netpoll_stub.go1
-rw-r--r--src/runtime/norace_linux_test.go1
-rw-r--r--src/runtime/norace_test.go1
-rw-r--r--src/runtime/os_aix.go1
-rw-r--r--src/runtime/os_freebsd2.go1
-rw-r--r--src/runtime/os_freebsd_noauxv.go4
-rw-r--r--src/runtime/os_js.go1
-rw-r--r--src/runtime/os_linux_arm64.go1
-rw-r--r--src/runtime/os_linux_be64.go1
-rw-r--r--src/runtime/os_linux_generic.go9
-rw-r--r--src/runtime/os_linux_mips64x.go1
-rw-r--r--src/runtime/os_linux_mipsx.go1
-rw-r--r--src/runtime/os_linux_noauxv.go4
-rw-r--r--src/runtime/os_linux_novdso.go4
-rw-r--r--src/runtime/os_linux_ppc64x.go1
-rw-r--r--src/runtime/os_linux_x86.go1
-rw-r--r--src/runtime/os_nonopenbsd.go1
-rw-r--r--src/runtime/os_only_solaris.go1
-rw-r--r--src/runtime/os_openbsd_libc.go1
-rw-r--r--src/runtime/os_openbsd_syscall.go4
-rw-r--r--src/runtime/os_openbsd_syscall1.go1
-rw-r--r--src/runtime/os_openbsd_syscall2.go1
-rw-r--r--src/runtime/panic32.go1
-rw-r--r--src/runtime/pprof/mprof_test.go19
-rw-r--r--src/runtime/pprof/pprof_norusage.go1
-rw-r--r--src/runtime/pprof/pprof_rusage.go1
-rw-r--r--src/runtime/pprof/pprof_test.go1
-rw-r--r--src/runtime/preempt_nonwindows.go1
-rw-r--r--src/runtime/race.go1
-rw-r--r--src/runtime/race/output_test.go1
-rw-r--r--src/runtime/race/race.go1
-rw-r--r--src/runtime/race/race_linux_test.go1
-rw-r--r--src/runtime/race/race_test.go1
-rw-r--r--src/runtime/race/race_unix_test.go1
-rw-r--r--src/runtime/race/race_windows_test.go1
-rw-r--r--src/runtime/race/sched_test.go1
-rw-r--r--src/runtime/race/syso_test.go1
-rw-r--r--src/runtime/race/timer_test.go1
-rw-r--r--src/runtime/race0.go1
-rw-r--r--src/runtime/relax_stub.go1
-rw-r--r--src/runtime/runtime_mmap_test.go1
-rw-r--r--src/runtime/runtime_unix_test.go1
-rw-r--r--src/runtime/semasleep_test.go1
-rw-r--r--src/runtime/sigaction.go1
-rw-r--r--src/runtime/signal_386.go1
-rw-r--r--src/runtime/signal_aix_ppc64.go1
-rw-r--r--src/runtime/signal_amd64.go1
-rw-r--r--src/runtime/signal_arm.go1
-rw-r--r--src/runtime/signal_arm64.go1
-rw-r--r--src/runtime/signal_linux_mips64x.go1
-rw-r--r--src/runtime/signal_linux_mipsx.go1
-rw-r--r--src/runtime/signal_linux_ppc64x.go1
-rw-r--r--src/runtime/signal_mips64x.go1
-rw-r--r--src/runtime/signal_mipsx.go1
-rw-r--r--src/runtime/signal_ppc64x.go1
-rw-r--r--src/runtime/signal_riscv64.go1
-rw-r--r--src/runtime/signal_unix.go1
-rw-r--r--src/runtime/signal_windows_test.go1
-rw-r--r--src/runtime/sigqueue.go1
-rw-r--r--src/runtime/sigqueue_note.go4
-rw-r--r--src/runtime/sigtab_linux_generic.go7
-rw-r--r--src/runtime/sigtab_linux_mipsx.go1
-rw-r--r--src/runtime/stubs2.go9
-rw-r--r--src/runtime/stubs3.go8
-rw-r--r--src/runtime/stubs_linux.go1
-rw-r--r--src/runtime/stubs_mips64x.go1
-rw-r--r--src/runtime/stubs_mipsx.go1
-rw-r--r--src/runtime/stubs_nonlinux.go1
-rw-r--r--src/runtime/stubs_ppc64x.go1
-rw-r--r--src/runtime/sys_libc.go1
-rw-r--r--src/runtime/sys_mips64x.go1
-rw-r--r--src/runtime/sys_mipsx.go1
-rw-r--r--src/runtime/sys_nonppc64x.go1
-rw-r--r--src/runtime/sys_openbsd.go1
-rw-r--r--src/runtime/sys_openbsd1.go1
-rw-r--r--src/runtime/sys_openbsd2.go1
-rw-r--r--src/runtime/sys_openbsd3.go1
-rw-r--r--src/runtime/sys_ppc64x.go1
-rw-r--r--src/runtime/sys_x86.go1
-rw-r--r--src/runtime/time_fake.go4
-rw-r--r--src/runtime/time_nofake.go1
-rw-r--r--src/runtime/timeasm.go1
-rw-r--r--src/runtime/timestub.go1
-rw-r--r--src/runtime/timestub2.go8
-rw-r--r--src/runtime/vdso_elf32.go1
-rw-r--r--src/runtime/vdso_elf64.go1
-rw-r--r--src/runtime/vdso_freebsd.go1
-rw-r--r--src/runtime/vdso_freebsd_x86.go1
-rw-r--r--src/runtime/vdso_in_none.go1
-rw-r--r--src/runtime/vdso_linux.go1
-rw-r--r--src/runtime/vdso_linux_mips64x.go1
-rw-r--r--src/runtime/vdso_linux_ppc64x.go1
-rw-r--r--src/runtime/vlrt.go1
-rw-r--r--src/runtime/wincallback.go1
-rw-r--r--src/runtime/write_err.go1
222 files changed, 249 insertions, 76 deletions
diff --git a/src/runtime/auxv_none.go b/src/runtime/auxv_none.go
index 3ca617b21e..3178f1a154 100644
--- a/src/runtime/auxv_none.go
+++ b/src/runtime/auxv_none.go
@@ -2,12 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !linux
-// +build !darwin
-// +build !dragonfly
-// +build !freebsd
-// +build !netbsd
-// +build !solaris
+//go:build !linux && !darwin && !dragonfly && !freebsd && !netbsd && !solaris
+// +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!solaris
package runtime
diff --git a/src/runtime/cgo/callbacks_traceback.go b/src/runtime/cgo/callbacks_traceback.go
index cdadf9e66f..7302c1eedf 100644
--- a/src/runtime/cgo/callbacks_traceback.go
+++ b/src/runtime/cgo/callbacks_traceback.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || linux
// +build darwin linux
package cgo
diff --git a/src/runtime/cgo/dragonfly.go b/src/runtime/cgo/dragonfly.go
index d6d69187b8..cfa6fe86e2 100644
--- a/src/runtime/cgo/dragonfly.go
+++ b/src/runtime/cgo/dragonfly.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build dragonfly
// +build dragonfly
package cgo
diff --git a/src/runtime/cgo/freebsd.go b/src/runtime/cgo/freebsd.go
index 5c9ddbdc71..d56702ec70 100644
--- a/src/runtime/cgo/freebsd.go
+++ b/src/runtime/cgo/freebsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build freebsd
// +build freebsd
package cgo
diff --git a/src/runtime/cgo/linux.go b/src/runtime/cgo/linux.go
index 76c0192c20..070d531bee 100644
--- a/src/runtime/cgo/linux.go
+++ b/src/runtime/cgo/linux.go
@@ -5,6 +5,7 @@
// Linux system call wrappers that provide POSIX semantics through the
// corresponding cgo->libc (nptl) wrappers for various system calls.
+//go:build linux
// +build linux
package cgo
diff --git a/src/runtime/cgo/mmap.go b/src/runtime/cgo/mmap.go
index 00fb7fced6..347ae6b363 100644
--- a/src/runtime/cgo/mmap.go
+++ b/src/runtime/cgo/mmap.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (linux && amd64) || (linux && arm64)
// +build linux,amd64 linux,arm64
package cgo
diff --git a/src/runtime/cgo/netbsd.go b/src/runtime/cgo/netbsd.go
index 74d0aed014..7e17d1fcd2 100644
--- a/src/runtime/cgo/netbsd.go
+++ b/src/runtime/cgo/netbsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build netbsd
// +build netbsd
package cgo
diff --git a/src/runtime/cgo/openbsd.go b/src/runtime/cgo/openbsd.go
index 81c73bf399..f6215613c3 100644
--- a/src/runtime/cgo/openbsd.go
+++ b/src/runtime/cgo/openbsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build openbsd
// +build openbsd
package cgo
diff --git a/src/runtime/cgo/setenv.go b/src/runtime/cgo/setenv.go
index 6495fcb5f8..e6e8040ae0 100644
--- a/src/runtime/cgo/setenv.go
+++ b/src/runtime/cgo/setenv.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package cgo
diff --git a/src/runtime/cgo/sigaction.go b/src/runtime/cgo/sigaction.go
index 076fbc1a0a..ee63ea4c09 100644
--- a/src/runtime/cgo/sigaction.go
+++ b/src/runtime/cgo/sigaction.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (linux && amd64) || (freebsd && amd64) || (linux && arm64)
// +build linux,amd64 freebsd,amd64 linux,arm64
package cgo
diff --git a/src/runtime/cgo_mmap.go b/src/runtime/cgo_mmap.go
index d5e0cc1e3e..17d26b4cc8 100644
--- a/src/runtime/cgo_mmap.go
+++ b/src/runtime/cgo_mmap.go
@@ -4,6 +4,7 @@
// Support for memory sanitizer. See runtime/cgo/mmap.go.
+//go:build (linux && amd64) || (linux && arm64)
// +build linux,amd64 linux,arm64
package runtime
diff --git a/src/runtime/cgo_ppc64x.go b/src/runtime/cgo_ppc64x.go
index fb2da32c7e..4dc92ea321 100644
--- a/src/runtime/cgo_ppc64x.go
+++ b/src/runtime/cgo_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ppc64 || ppc64le
// +build ppc64 ppc64le
package runtime
diff --git a/src/runtime/cgo_sigaction.go b/src/runtime/cgo_sigaction.go
index de634dc957..15690ecb0b 100644
--- a/src/runtime/cgo_sigaction.go
+++ b/src/runtime/cgo_sigaction.go
@@ -4,6 +4,7 @@
// Support for memory sanitizer. See runtime/cgo/sigaction.go.
+//go:build (linux && amd64) || (freebsd && amd64) || (linux && arm64)
// +build linux,amd64 freebsd,amd64 linux,arm64
package runtime
diff --git a/src/runtime/cputicks.go b/src/runtime/cputicks.go
index 7beb57ea12..7c926f4a2b 100644
--- a/src/runtime/cputicks.go
+++ b/src/runtime/cputicks.go
@@ -2,13 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !arm
-// +build !arm64
-// +build !mips64
-// +build !mips64le
-// +build !mips
-// +build !mipsle
-// +build !wasm
+//go:build !arm && !arm64 && !mips64 && !mips64le && !mips && !mipsle && !wasm
+// +build !arm,!arm64,!mips64,!mips64le,!mips,!mipsle,!wasm
package runtime
diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go
index 140c170ddc..7d25c51aa2 100644
--- a/src/runtime/crash_cgo_test.go
+++ b/src/runtime/crash_cgo_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build cgo
// +build cgo
package runtime_test
diff --git a/src/runtime/crash_nonunix_test.go b/src/runtime/crash_nonunix_test.go
index 06c197ec2b..5f61476f21 100644
--- a/src/runtime/crash_nonunix_test.go
+++ b/src/runtime/crash_nonunix_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build windows || plan9 || (js && wasm)
// +build windows plan9 js,wasm
package runtime_test
diff --git a/src/runtime/crash_unix_test.go b/src/runtime/crash_unix_test.go
index 803b031873..341c35ca56 100644
--- a/src/runtime/crash_unix_test.go
+++ b/src/runtime/crash_unix_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package runtime_test
diff --git a/src/runtime/debug/panic_test.go b/src/runtime/debug/panic_test.go
index b67a3de4f9..b93631e1d8 100644
--- a/src/runtime/debug/panic_test.go
+++ b/src/runtime/debug/panic_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build aix darwin dragonfly freebsd linux netbsd openbsd
// TODO: test on Windows?
diff --git a/src/runtime/debug_test.go b/src/runtime/debug_test.go
index a0b3f84382..c4c41f95f2 100644
--- a/src/runtime/debug_test.go
+++ b/src/runtime/debug_test.go
@@ -9,9 +9,8 @@
// spends all of its time in the race runtime, which isn't a safe
// point.
-// +build amd64
-// +build linux
-// +build !race
+//go:build amd64 && linux && !race
+// +build amd64,linux,!race
package runtime_test
diff --git a/src/runtime/debugcall.go b/src/runtime/debugcall.go
index efc68a767d..2fe0b1d12f 100644
--- a/src/runtime/debugcall.go
+++ b/src/runtime/debugcall.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build amd64
// +build amd64
package runtime
diff --git a/src/runtime/debuglog_off.go b/src/runtime/debuglog_off.go
index bb3e172498..dd38156999 100644
--- a/src/runtime/debuglog_off.go
+++ b/src/runtime/debuglog_off.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !debuglog
// +build !debuglog
package runtime
diff --git a/src/runtime/debuglog_on.go b/src/runtime/debuglog_on.go
index 3d477e8ef5..2fcdbe70d1 100644
--- a/src/runtime/debuglog_on.go
+++ b/src/runtime/debuglog_on.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build debuglog
// +build debuglog
package runtime
diff --git a/src/runtime/defs1_linux.go b/src/runtime/defs1_linux.go
index 4085d6f418..df9c05dd5e 100644
--- a/src/runtime/defs1_linux.go
+++ b/src/runtime/defs1_linux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs2_linux.go b/src/runtime/defs2_linux.go
index 87e19c1598..d016db7d02 100644
--- a/src/runtime/defs2_linux.go
+++ b/src/runtime/defs2_linux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs3_linux.go b/src/runtime/defs3_linux.go
index 31f2191c76..0a06aa2370 100644
--- a/src/runtime/defs3_linux.go
+++ b/src/runtime/defs3_linux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_aix.go b/src/runtime/defs_aix.go
index 23a6cac2bb..1605002ea2 100644
--- a/src/runtime/defs_aix.go
+++ b/src/runtime/defs_aix.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_aix_ppc64.go b/src/runtime/defs_aix_ppc64.go
index a53fcc5933..f84ff1160d 100644
--- a/src/runtime/defs_aix_ppc64.go
+++ b/src/runtime/defs_aix_ppc64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix
// +build aix
package runtime
diff --git a/src/runtime/defs_arm_linux.go b/src/runtime/defs_arm_linux.go
index e51dd32b5b..f6b6dd2c09 100644
--- a/src/runtime/defs_arm_linux.go
+++ b/src/runtime/defs_arm_linux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_darwin.go b/src/runtime/defs_darwin.go
index cc8c475387..2d41a97b57 100644
--- a/src/runtime/defs_darwin.go
+++ b/src/runtime/defs_darwin.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_dragonfly.go b/src/runtime/defs_dragonfly.go
index 95014fe6e7..225258901f 100644
--- a/src/runtime/defs_dragonfly.go
+++ b/src/runtime/defs_dragonfly.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_freebsd.go b/src/runtime/defs_freebsd.go
index e196dff076..c258759549 100644
--- a/src/runtime/defs_freebsd.go
+++ b/src/runtime/defs_freebsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_linux.go b/src/runtime/defs_linux.go
index 7b14063386..022ef19427 100644
--- a/src/runtime/defs_linux.go
+++ b/src/runtime/defs_linux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_linux_mips64x.go b/src/runtime/defs_linux_mips64x.go
index 1fb423b198..2cafad20cf 100644
--- a/src/runtime/defs_linux_mips64x.go
+++ b/src/runtime/defs_linux_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (mips64 || mips64le) && linux
// +build mips64 mips64le
// +build linux
diff --git a/src/runtime/defs_linux_mipsx.go b/src/runtime/defs_linux_mipsx.go
index 9315ba9346..3a8dfe2e99 100644
--- a/src/runtime/defs_linux_mipsx.go
+++ b/src/runtime/defs_linux_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (mips || mipsle) && linux
// +build mips mipsle
// +build linux
diff --git a/src/runtime/defs_netbsd.go b/src/runtime/defs_netbsd.go
index 3f5ce5adca..755992d18e 100644
--- a/src/runtime/defs_netbsd.go
+++ b/src/runtime/defs_netbsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_netbsd_386.go b/src/runtime/defs_netbsd_386.go
index c26f246077..03c9c2de59 100644
--- a/src/runtime/defs_netbsd_386.go
+++ b/src/runtime/defs_netbsd_386.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_netbsd_amd64.go b/src/runtime/defs_netbsd_amd64.go
index f18a7b1fe3..9fda1d7d22 100644
--- a/src/runtime/defs_netbsd_amd64.go
+++ b/src/runtime/defs_netbsd_amd64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_netbsd_arm.go b/src/runtime/defs_netbsd_arm.go
index cb0dce66b4..e7f4f6cece 100644
--- a/src/runtime/defs_netbsd_arm.go
+++ b/src/runtime/defs_netbsd_arm.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_openbsd.go b/src/runtime/defs_openbsd.go
index ff7e21c71e..8d323449d1 100644
--- a/src/runtime/defs_openbsd.go
+++ b/src/runtime/defs_openbsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_solaris.go b/src/runtime/defs_solaris.go
index 22df59094d..e644f9c6dd 100644
--- a/src/runtime/defs_solaris.go
+++ b/src/runtime/defs_solaris.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/defs_solaris_amd64.go b/src/runtime/defs_solaris_amd64.go
index 0493178880..a0b38319a5 100644
--- a/src/runtime/defs_solaris_amd64.go
+++ b/src/runtime/defs_solaris_amd64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
/*
diff --git a/src/runtime/env_posix.go b/src/runtime/env_posix.go
index af353bbcd9..95517b2a95 100644
--- a/src/runtime/env_posix.go
+++ b/src/runtime/env_posix.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || windows || plan9
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows plan9
package runtime
diff --git a/src/runtime/export_debug_test.go b/src/runtime/export_debug_test.go
index ed4242ef24..18ccecd5cd 100644
--- a/src/runtime/export_debug_test.go
+++ b/src/runtime/export_debug_test.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build amd64
-// +build linux
+//go:build amd64 && linux
+// +build amd64,linux
package runtime
diff --git a/src/runtime/export_futex_test.go b/src/runtime/export_futex_test.go
index a727a93114..34c970d6d2 100644
--- a/src/runtime/export_futex_test.go
+++ b/src/runtime/export_futex_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build dragonfly || freebsd || linux
// +build dragonfly freebsd linux
package runtime
diff --git a/src/runtime/export_mmap_test.go b/src/runtime/export_mmap_test.go
index aeaf37f64b..bf4a815899 100644
--- a/src/runtime/export_mmap_test.go
+++ b/src/runtime/export_mmap_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
// Export guts for testing.
diff --git a/src/runtime/export_pipe2_test.go b/src/runtime/export_pipe2_test.go
index 9d580d3313..31c8e43b3f 100644
--- a/src/runtime/export_pipe2_test.go
+++ b/src/runtime/export_pipe2_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build freebsd || linux || netbsd || openbsd || solaris
// +build freebsd linux netbsd openbsd solaris
package runtime
diff --git a/src/runtime/export_pipe_test.go b/src/runtime/export_pipe_test.go
index 8f66770fb9..82032e6bfb 100644
--- a/src/runtime/export_pipe_test.go
+++ b/src/runtime/export_pipe_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly
// +build aix darwin dragonfly
package runtime
diff --git a/src/runtime/export_unix_test.go b/src/runtime/export_unix_test.go
index 307c63fd68..215e234286 100644
--- a/src/runtime/export_unix_test.go
+++ b/src/runtime/export_unix_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package runtime
diff --git a/src/runtime/futex_test.go b/src/runtime/futex_test.go
index 3051bd5880..10a735327a 100644
--- a/src/runtime/futex_test.go
+++ b/src/runtime/futex_test.go
@@ -6,6 +6,7 @@
// The race detector emits calls to split stack functions so it breaks
// the test.
+//go:build (dragonfly || freebsd || linux) && !race
// +build dragonfly freebsd linux
// +build !race
diff --git a/src/runtime/hash32.go b/src/runtime/hash32.go
index 966f70e1aa..7fa8eb7cab 100644
--- a/src/runtime/hash32.go
+++ b/src/runtime/hash32.go
@@ -6,6 +6,7 @@
// xxhash: https://code.google.com/p/xxhash/
// cityhash: https://code.google.com/p/cityhash/
+//go:build 386 || arm || mips || mipsle
// +build 386 arm mips mipsle
package runtime
diff --git a/src/runtime/hash64.go b/src/runtime/hash64.go
index d1283824ad..1bee666bd7 100644
--- a/src/runtime/hash64.go
+++ b/src/runtime/hash64.go
@@ -6,6 +6,7 @@
// xxhash: https://code.google.com/p/xxhash/
// cityhash: https://code.google.com/p/cityhash/
+//go:build amd64 || arm64 || mips64 || mips64le || ppc64 || ppc64le || riscv64 || s390x || wasm
// +build amd64 arm64 mips64 mips64le ppc64 ppc64le riscv64 s390x wasm
package runtime
diff --git a/src/runtime/internal/atomic/atomic_386.go b/src/runtime/internal/atomic/atomic_386.go
index 1bfcb1143d..d4aed6b671 100644
--- a/src/runtime/internal/atomic/atomic_386.go
+++ b/src/runtime/internal/atomic/atomic_386.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build 386
// +build 386
package atomic
diff --git a/src/runtime/internal/atomic/atomic_arm.go b/src/runtime/internal/atomic/atomic_arm.go
index 546b3d6120..2e9374ca26 100644
--- a/src/runtime/internal/atomic/atomic_arm.go
+++ b/src/runtime/internal/atomic/atomic_arm.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build arm
// +build arm
package atomic
diff --git a/src/runtime/internal/atomic/atomic_arm64.go b/src/runtime/internal/atomic/atomic_arm64.go
index d49bee8936..131c687e1b 100644
--- a/src/runtime/internal/atomic/atomic_arm64.go
+++ b/src/runtime/internal/atomic/atomic_arm64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build arm64
// +build arm64
package atomic
diff --git a/src/runtime/internal/atomic/atomic_mips64x.go b/src/runtime/internal/atomic/atomic_mips64x.go
index b0109d72b0..5b407ebc7a 100644
--- a/src/runtime/internal/atomic/atomic_mips64x.go
+++ b/src/runtime/internal/atomic/atomic_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build mips64 || mips64le
// +build mips64 mips64le
package atomic
diff --git a/src/runtime/internal/atomic/atomic_mipsx.go b/src/runtime/internal/atomic/atomic_mipsx.go
index 1336b50121..80cd65b333 100644
--- a/src/runtime/internal/atomic/atomic_mipsx.go
+++ b/src/runtime/internal/atomic/atomic_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build mips || mipsle
// +build mips mipsle
// Export some functions via linkname to assembly in sync/atomic.
diff --git a/src/runtime/internal/atomic/atomic_ppc64x.go b/src/runtime/internal/atomic/atomic_ppc64x.go
index e4b109f0ec..98101e3287 100644
--- a/src/runtime/internal/atomic/atomic_ppc64x.go
+++ b/src/runtime/internal/atomic/atomic_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ppc64 || ppc64le
// +build ppc64 ppc64le
package atomic
diff --git a/src/runtime/internal/atomic/stubs.go b/src/runtime/internal/atomic/stubs.go
index 62e30d1788..1275884b2f 100644
--- a/src/runtime/internal/atomic/stubs.go
+++ b/src/runtime/internal/atomic/stubs.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !wasm
// +build !wasm
package atomic
diff --git a/src/runtime/internal/sys/gengoos.go b/src/runtime/internal/sys/gengoos.go
index 9bbc48d94f..51f64a6e5c 100644
--- a/src/runtime/internal/sys/gengoos.go
+++ b/src/runtime/internal/sys/gengoos.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
package main
diff --git a/src/runtime/internal/sys/intrinsics.go b/src/runtime/internal/sys/intrinsics.go
index 3c8898236c..e76d8dd064 100644
--- a/src/runtime/internal/sys/intrinsics.go
+++ b/src/runtime/internal/sys/intrinsics.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !386
// +build !386
// TODO finish intrinsifying 386, deadcode the assembly, remove build tags, merge w/ intrinsics_common
diff --git a/src/runtime/internal/sys/intrinsics_stubs.go b/src/runtime/internal/sys/intrinsics_stubs.go
index 9cbf48216c..bf1494d48a 100644
--- a/src/runtime/internal/sys/intrinsics_stubs.go
+++ b/src/runtime/internal/sys/intrinsics_stubs.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build 386
// +build 386
package sys
diff --git a/src/runtime/internal/sys/zgoarch_386.go b/src/runtime/internal/sys/zgoarch_386.go
index c286d0df2b..98a2401bfe 100644
--- a/src/runtime/internal/sys/zgoarch_386.go
+++ b/src/runtime/internal/sys/zgoarch_386.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build 386
// +build 386
package sys
diff --git a/src/runtime/internal/sys/zgoarch_amd64.go b/src/runtime/internal/sys/zgoarch_amd64.go
index d21c1d7d2a..d8faa5c786 100644
--- a/src/runtime/internal/sys/zgoarch_amd64.go
+++ b/src/runtime/internal/sys/zgoarch_amd64.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build amd64
// +build amd64
package sys
diff --git a/src/runtime/internal/sys/zgoarch_arm.go b/src/runtime/internal/sys/zgoarch_arm.go
index 9085fb0ea8..b64a69c9b4 100644
--- a/src/runtime/internal/sys/zgoarch_arm.go
+++ b/src/runtime/internal/sys/zgoarch_arm.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build arm
// +build arm
package sys
diff --git a/src/runtime/internal/sys/zgoarch_arm64.go b/src/runtime/internal/sys/zgoarch_arm64.go
index ed7ef2ebcb..de6f85347b 100644
--- a/src/runtime/internal/sys/zgoarch_arm64.go
+++ b/src/runtime/internal/sys/zgoarch_arm64.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build arm64
// +build arm64
package sys
diff --git a/src/runtime/internal/sys/zgoarch_arm64be.go b/src/runtime/internal/sys/zgoarch_arm64be.go
index faf3111053..b762bb069f 100644
--- a/src/runtime/internal/sys/zgoarch_arm64be.go
+++ b/src/runtime/internal/sys/zgoarch_arm64be.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build arm64be
// +build arm64be
package sys
diff --git a/src/runtime/internal/sys/zgoarch_armbe.go b/src/runtime/internal/sys/zgoarch_armbe.go
index cb28301e0b..e5297e4b16 100644
--- a/src/runtime/internal/sys/zgoarch_armbe.go
+++ b/src/runtime/internal/sys/zgoarch_armbe.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build armbe
// +build armbe
package sys
diff --git a/src/runtime/internal/sys/zgoarch_mips.go b/src/runtime/internal/sys/zgoarch_mips.go
index 315dea1c84..b5f4ed390c 100644
--- a/src/runtime/internal/sys/zgoarch_mips.go
+++ b/src/runtime/internal/sys/zgoarch_mips.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build mips
// +build mips
package sys
diff --git a/src/runtime/internal/sys/zgoarch_mips64.go b/src/runtime/internal/sys/zgoarch_mips64.go
index 5258cbfbe7..73777cceb2 100644
--- a/src/runtime/internal/sys/zgoarch_mips64.go
+++ b/src/runtime/internal/sys/zgoarch_mips64.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build mips64
// +build mips64
package sys
diff --git a/src/runtime/internal/sys/zgoarch_mips64le.go b/src/runtime/internal/sys/zgoarch_mips64le.go
index 1721698518..0c81c36c09 100644
--- a/src/runtime/internal/sys/zgoarch_mips64le.go
+++ b/src/runtime/internal/sys/zgoarch_mips64le.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build mips64le
// +build mips64le
package sys
diff --git a/src/runtime/internal/sys/zgoarch_mips64p32.go b/src/runtime/internal/sys/zgoarch_mips64p32.go
index 44c4624da9..d63ce27d24 100644
--- a/src/runtime/internal/sys/zgoarch_mips64p32.go
+++ b/src/runtime/internal/sys/zgoarch_mips64p32.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build mips64p32
// +build mips64p32
package sys
diff --git a/src/runtime/internal/sys/zgoarch_mips64p32le.go b/src/runtime/internal/sys/zgoarch_mips64p32le.go
index eb63225430..2d577890b2 100644
--- a/src/runtime/internal/sys/zgoarch_mips64p32le.go
+++ b/src/runtime/internal/sys/zgoarch_mips64p32le.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build mips64p32le
// +build mips64p32le
package sys
diff --git a/src/runtime/internal/sys/zgoarch_mipsle.go b/src/runtime/internal/sys/zgoarch_mipsle.go
index e0ebfbf038..8af919d03a 100644
--- a/src/runtime/internal/sys/zgoarch_mipsle.go
+++ b/src/runtime/internal/sys/zgoarch_mipsle.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build mipsle
// +build mipsle
package sys
diff --git a/src/runtime/internal/sys/zgoarch_ppc.go b/src/runtime/internal/sys/zgoarch_ppc.go
index ef26aa3201..f6f12a5ddc 100644
--- a/src/runtime/internal/sys/zgoarch_ppc.go
+++ b/src/runtime/internal/sys/zgoarch_ppc.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build ppc
// +build ppc
package sys
diff --git a/src/runtime/internal/sys/zgoarch_ppc64.go b/src/runtime/internal/sys/zgoarch_ppc64.go
index 32c2d46d4c..a8379601f4 100644
--- a/src/runtime/internal/sys/zgoarch_ppc64.go
+++ b/src/runtime/internal/sys/zgoarch_ppc64.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build ppc64
// +build ppc64
package sys
diff --git a/src/runtime/internal/sys/zgoarch_ppc64le.go b/src/runtime/internal/sys/zgoarch_ppc64le.go
index 3a6e56763c..f2ec5dcba7 100644
--- a/src/runtime/internal/sys/zgoarch_ppc64le.go
+++ b/src/runtime/internal/sys/zgoarch_ppc64le.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build ppc64le
// +build ppc64le
package sys
diff --git a/src/runtime/internal/sys/zgoarch_riscv.go b/src/runtime/internal/sys/zgoarch_riscv.go
index d8f6b49093..83a3312f5f 100644
--- a/src/runtime/internal/sys/zgoarch_riscv.go
+++ b/src/runtime/internal/sys/zgoarch_riscv.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build riscv
// +build riscv
package sys
diff --git a/src/runtime/internal/sys/zgoarch_riscv64.go b/src/runtime/internal/sys/zgoarch_riscv64.go
index 0ba843b5ac..1dfcc84997 100644
--- a/src/runtime/internal/sys/zgoarch_riscv64.go
+++ b/src/runtime/internal/sys/zgoarch_riscv64.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build riscv64
// +build riscv64
package sys
diff --git a/src/runtime/internal/sys/zgoarch_s390.go b/src/runtime/internal/sys/zgoarch_s390.go
index 20a1b234a6..91aba5a0f6 100644
--- a/src/runtime/internal/sys/zgoarch_s390.go
+++ b/src/runtime/internal/sys/zgoarch_s390.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build s390
// +build s390
package sys
diff --git a/src/runtime/internal/sys/zgoarch_s390x.go b/src/runtime/internal/sys/zgoarch_s390x.go
index ffdda0c827..edce50234e 100644
--- a/src/runtime/internal/sys/zgoarch_s390x.go
+++ b/src/runtime/internal/sys/zgoarch_s390x.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build s390x
// +build s390x
package sys
diff --git a/src/runtime/internal/sys/zgoarch_sparc.go b/src/runtime/internal/sys/zgoarch_sparc.go
index b4949510d5..5ae9560ab0 100644
--- a/src/runtime/internal/sys/zgoarch_sparc.go
+++ b/src/runtime/internal/sys/zgoarch_sparc.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build sparc
// +build sparc
package sys
diff --git a/src/runtime/internal/sys/zgoarch_sparc64.go b/src/runtime/internal/sys/zgoarch_sparc64.go
index 0f6df411ce..e2a0134aff 100644
--- a/src/runtime/internal/sys/zgoarch_sparc64.go
+++ b/src/runtime/internal/sys/zgoarch_sparc64.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build sparc64
// +build sparc64
package sys
diff --git a/src/runtime/internal/sys/zgoarch_wasm.go b/src/runtime/internal/sys/zgoarch_wasm.go
index e69afb0cb3..52e85dea37 100644
--- a/src/runtime/internal/sys/zgoarch_wasm.go
+++ b/src/runtime/internal/sys/zgoarch_wasm.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build wasm
// +build wasm
package sys
diff --git a/src/runtime/internal/sys/zgoos_aix.go b/src/runtime/internal/sys/zgoos_aix.go
index 0631d02aa5..f3b907471f 100644
--- a/src/runtime/internal/sys/zgoos_aix.go
+++ b/src/runtime/internal/sys/zgoos_aix.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build aix
// +build aix
package sys
diff --git a/src/runtime/internal/sys/zgoos_android.go b/src/runtime/internal/sys/zgoos_android.go
index d356a40bec..e28baf7c48 100644
--- a/src/runtime/internal/sys/zgoos_android.go
+++ b/src/runtime/internal/sys/zgoos_android.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build android
// +build android
package sys
diff --git a/src/runtime/internal/sys/zgoos_darwin.go b/src/runtime/internal/sys/zgoos_darwin.go
index 6aa2db7e3a..3c7f7b543e 100644
--- a/src/runtime/internal/sys/zgoos_darwin.go
+++ b/src/runtime/internal/sys/zgoos_darwin.go
@@ -1,7 +1,7 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
-// +build !ios
-// +build darwin
+//go:build !ios && darwin
+// +build !ios,darwin
package sys
diff --git a/src/runtime/internal/sys/zgoos_dragonfly.go b/src/runtime/internal/sys/zgoos_dragonfly.go
index 88ee1174f1..f844d29e2a 100644
--- a/src/runtime/internal/sys/zgoos_dragonfly.go
+++ b/src/runtime/internal/sys/zgoos_dragonfly.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build dragonfly
// +build dragonfly
package sys
diff --git a/src/runtime/internal/sys/zgoos_freebsd.go b/src/runtime/internal/sys/zgoos_freebsd.go
index 8de2ec0559..8999a2797a 100644
--- a/src/runtime/internal/sys/zgoos_freebsd.go
+++ b/src/runtime/internal/sys/zgoos_freebsd.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build freebsd
// +build freebsd
package sys
diff --git a/src/runtime/internal/sys/zgoos_hurd.go b/src/runtime/internal/sys/zgoos_hurd.go
index 183ccb02a1..a546488bf8 100644
--- a/src/runtime/internal/sys/zgoos_hurd.go
+++ b/src/runtime/internal/sys/zgoos_hurd.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build hurd
// +build hurd
package sys
diff --git a/src/runtime/internal/sys/zgoos_illumos.go b/src/runtime/internal/sys/zgoos_illumos.go
index d04134e1df..02a4ca06e8 100644
--- a/src/runtime/internal/sys/zgoos_illumos.go
+++ b/src/runtime/internal/sys/zgoos_illumos.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build illumos
// +build illumos
package sys
diff --git a/src/runtime/internal/sys/zgoos_ios.go b/src/runtime/internal/sys/zgoos_ios.go
index cf6e9d61f0..033eec623d 100644
--- a/src/runtime/internal/sys/zgoos_ios.go
+++ b/src/runtime/internal/sys/zgoos_ios.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build ios
// +build ios
package sys
diff --git a/src/runtime/internal/sys/zgoos_js.go b/src/runtime/internal/sys/zgoos_js.go
index 1d9279ab38..28226ad60a 100644
--- a/src/runtime/internal/sys/zgoos_js.go
+++ b/src/runtime/internal/sys/zgoos_js.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build js
// +build js
package sys
diff --git a/src/runtime/internal/sys/zgoos_linux.go b/src/runtime/internal/sys/zgoos_linux.go
index 0f718d704f..01546e4b9f 100644
--- a/src/runtime/internal/sys/zgoos_linux.go
+++ b/src/runtime/internal/sys/zgoos_linux.go
@@ -1,7 +1,7 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
-// +build !android
-// +build linux
+//go:build !android && linux
+// +build !android,linux
package sys
diff --git a/src/runtime/internal/sys/zgoos_netbsd.go b/src/runtime/internal/sys/zgoos_netbsd.go
index 2ae149ff13..9d658b20ee 100644
--- a/src/runtime/internal/sys/zgoos_netbsd.go
+++ b/src/runtime/internal/sys/zgoos_netbsd.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build netbsd
// +build netbsd
package sys
diff --git a/src/runtime/internal/sys/zgoos_openbsd.go b/src/runtime/internal/sys/zgoos_openbsd.go
index 7d4d61e4ca..0f55454a95 100644
--- a/src/runtime/internal/sys/zgoos_openbsd.go
+++ b/src/runtime/internal/sys/zgoos_openbsd.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build openbsd
// +build openbsd
package sys
diff --git a/src/runtime/internal/sys/zgoos_plan9.go b/src/runtime/internal/sys/zgoos_plan9.go
index 30aec46df3..d0347464d6 100644
--- a/src/runtime/internal/sys/zgoos_plan9.go
+++ b/src/runtime/internal/sys/zgoos_plan9.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build plan9
// +build plan9
package sys
diff --git a/src/runtime/internal/sys/zgoos_solaris.go b/src/runtime/internal/sys/zgoos_solaris.go
index 4bb8c99bce..05c3007e2c 100644
--- a/src/runtime/internal/sys/zgoos_solaris.go
+++ b/src/runtime/internal/sys/zgoos_solaris.go
@@ -1,7 +1,7 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
-// +build !illumos
-// +build solaris
+//go:build !illumos && solaris
+// +build !illumos,solaris
package sys
diff --git a/src/runtime/internal/sys/zgoos_windows.go b/src/runtime/internal/sys/zgoos_windows.go
index d1f4290204..7d07fa3a45 100644
--- a/src/runtime/internal/sys/zgoos_windows.go
+++ b/src/runtime/internal/sys/zgoos_windows.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build windows
// +build windows
package sys
diff --git a/src/runtime/internal/sys/zgoos_zos.go b/src/runtime/internal/sys/zgoos_zos.go
index d22be46fc0..d6e5b9b0cb 100644
--- a/src/runtime/internal/sys/zgoos_zos.go
+++ b/src/runtime/internal/sys/zgoos_zos.go
@@ -1,5 +1,6 @@
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+//go:build zos
// +build zos
package sys
diff --git a/src/runtime/lfstack_32bit.go b/src/runtime/lfstack_32bit.go
index f07ff1c06b..c00f0965bd 100644
--- a/src/runtime/lfstack_32bit.go
+++ b/src/runtime/lfstack_32bit.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build 386 || arm || mips || mipsle
// +build 386 arm mips mipsle
package runtime
diff --git a/src/runtime/lfstack_64bit.go b/src/runtime/lfstack_64bit.go
index 9d821b989e..4812dd1156 100644
--- a/src/runtime/lfstack_64bit.go
+++ b/src/runtime/lfstack_64bit.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build amd64 || arm64 || mips64 || mips64le || ppc64 || ppc64le || riscv64 || s390x || wasm
// +build amd64 arm64 mips64 mips64le ppc64 ppc64le riscv64 s390x wasm
package runtime
diff --git a/src/runtime/libfuzzer.go b/src/runtime/libfuzzer.go
index 0161955f09..578bce0414 100644
--- a/src/runtime/libfuzzer.go
+++ b/src/runtime/libfuzzer.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build libfuzzer
// +build libfuzzer
package runtime
diff --git a/src/runtime/lock_futex.go b/src/runtime/lock_futex.go
index 91467fdfae..017b481c64 100644
--- a/src/runtime/lock_futex.go
+++ b/src/runtime/lock_futex.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build dragonfly || freebsd || linux
// +build dragonfly freebsd linux
package runtime
diff --git a/src/runtime/lock_js.go b/src/runtime/lock_js.go
index 14bdc76842..04e7e85c12 100644
--- a/src/runtime/lock_js.go
+++ b/src/runtime/lock_js.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build js && wasm
// +build js,wasm
package runtime
diff --git a/src/runtime/lock_sema.go b/src/runtime/lock_sema.go
index 671e524e45..3c0a7ca67e 100644
--- a/src/runtime/lock_sema.go
+++ b/src/runtime/lock_sema.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || netbsd || openbsd || plan9 || solaris || windows
// +build aix darwin netbsd openbsd plan9 solaris windows
package runtime
diff --git a/src/runtime/lockrank_off.go b/src/runtime/lockrank_off.go
index 7dcd8f5fe9..f3d2c00914 100644
--- a/src/runtime/lockrank_off.go
+++ b/src/runtime/lockrank_off.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !goexperiment.staticlockranking
// +build !goexperiment.staticlockranking
package runtime
diff --git a/src/runtime/lockrank_on.go b/src/runtime/lockrank_on.go
index 88ac95a004..702bf5f24c 100644
--- a/src/runtime/lockrank_on.go
+++ b/src/runtime/lockrank_on.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build goexperiment.staticlockranking
// +build goexperiment.staticlockranking
package runtime
diff --git a/src/runtime/mem_bsd.go b/src/runtime/mem_bsd.go
index bc672019fb..dcbb9a1d51 100644
--- a/src/runtime/mem_bsd.go
+++ b/src/runtime/mem_bsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build dragonfly || freebsd || netbsd || openbsd || solaris
// +build dragonfly freebsd netbsd openbsd solaris
package runtime
diff --git a/src/runtime/mem_js.go b/src/runtime/mem_js.go
index 957ed36ffa..fe940360c0 100644
--- a/src/runtime/mem_js.go
+++ b/src/runtime/mem_js.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build js && wasm
// +build js,wasm
package runtime
diff --git a/src/runtime/mkduff.go b/src/runtime/mkduff.go
index ef297f073e..8632fe08a3 100644
--- a/src/runtime/mkduff.go
+++ b/src/runtime/mkduff.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
// runtime·duffzero is a Duff's device for zeroing memory.
diff --git a/src/runtime/mkfastlog2table.go b/src/runtime/mkfastlog2table.go
index d650292394..8d78a3923a 100644
--- a/src/runtime/mkfastlog2table.go
+++ b/src/runtime/mkfastlog2table.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
// fastlog2Table contains log2 approximations for 5 binary digits.
diff --git a/src/runtime/mkpreempt.go b/src/runtime/mkpreempt.go
index 1d614dd003..3069d6ed04 100644
--- a/src/runtime/mkpreempt.go
+++ b/src/runtime/mkpreempt.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
// mkpreempt generates the asyncPreempt functions for each
diff --git a/src/runtime/mksizeclasses.go b/src/runtime/mksizeclasses.go
index b92d1fed5f..b4a117d343 100644
--- a/src/runtime/mksizeclasses.go
+++ b/src/runtime/mksizeclasses.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
// Generate tables for small malloc size classes.
diff --git a/src/runtime/mmap.go b/src/runtime/mmap.go
index 1b1848b79e..7460eb3104 100644
--- a/src/runtime/mmap.go
+++ b/src/runtime/mmap.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !aix && !darwin && !js && (!linux || !amd64) && (!linux || !arm64) && !openbsd && !plan9 && !solaris && !windows
// +build !aix
// +build !darwin
// +build !js
diff --git a/src/runtime/mpagealloc_32bit.go b/src/runtime/mpagealloc_32bit.go
index 331dadade9..fceb4e7a18 100644
--- a/src/runtime/mpagealloc_32bit.go
+++ b/src/runtime/mpagealloc_32bit.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build 386 || arm || mips || mipsle || wasm || (ios && arm64)
// +build 386 arm mips mipsle wasm ios,arm64
// wasm is a treated as a 32-bit architecture for the purposes of the page
diff --git a/src/runtime/mpagealloc_64bit.go b/src/runtime/mpagealloc_64bit.go
index ffacb46c18..16577346a7 100644
--- a/src/runtime/mpagealloc_64bit.go
+++ b/src/runtime/mpagealloc_64bit.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build amd64 || (!ios && arm64) || mips64 || mips64le || ppc64 || ppc64le || riscv64 || s390x
// +build amd64 !ios,arm64 mips64 mips64le ppc64 ppc64le riscv64 s390x
// See mpagealloc_32bit.go for why ios/arm64 is excluded here.
diff --git a/src/runtime/msan.go b/src/runtime/msan.go
index 6a5960b0a8..25aaf94e26 100644
--- a/src/runtime/msan.go
+++ b/src/runtime/msan.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build msan
// +build msan
package runtime
diff --git a/src/runtime/msan0.go b/src/runtime/msan0.go
index 374d13f30b..b1096a6750 100644
--- a/src/runtime/msan0.go
+++ b/src/runtime/msan0.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !msan
// +build !msan
// Dummy MSan support API, used when not built with -msan.
diff --git a/src/runtime/nbpipe_fcntl_libc_test.go b/src/runtime/nbpipe_fcntl_libc_test.go
index b38c58399b..076a722eb7 100644
--- a/src/runtime/nbpipe_fcntl_libc_test.go
+++ b/src/runtime/nbpipe_fcntl_libc_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || solaris
// +build aix darwin solaris
package runtime_test
diff --git a/src/runtime/nbpipe_fcntl_unix_test.go b/src/runtime/nbpipe_fcntl_unix_test.go
index 75acdb62dd..6d5e4ff021 100644
--- a/src/runtime/nbpipe_fcntl_unix_test.go
+++ b/src/runtime/nbpipe_fcntl_unix_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build dragonfly || freebsd || linux || netbsd || openbsd
// +build dragonfly freebsd linux netbsd openbsd
package runtime_test
diff --git a/src/runtime/nbpipe_pipe.go b/src/runtime/nbpipe_pipe.go
index 822b2944db..d92cf97217 100644
--- a/src/runtime/nbpipe_pipe.go
+++ b/src/runtime/nbpipe_pipe.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly
// +build aix darwin dragonfly
package runtime
diff --git a/src/runtime/nbpipe_pipe2.go b/src/runtime/nbpipe_pipe2.go
index e3639d99b1..f138d1f956 100644
--- a/src/runtime/nbpipe_pipe2.go
+++ b/src/runtime/nbpipe_pipe2.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build freebsd || linux || netbsd || openbsd || solaris
// +build freebsd linux netbsd openbsd solaris
package runtime
diff --git a/src/runtime/nbpipe_test.go b/src/runtime/nbpipe_test.go
index d739f57864..1d6a9b525c 100644
--- a/src/runtime/nbpipe_test.go
+++ b/src/runtime/nbpipe_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package runtime_test
diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go
index 77eb3aa4c6..afb208a455 100644
--- a/src/runtime/netpoll.go
+++ b/src/runtime/netpoll.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || windows
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package runtime
diff --git a/src/runtime/netpoll_epoll.go b/src/runtime/netpoll_epoll.go
index 58f4fa8754..371ac59f8e 100644
--- a/src/runtime/netpoll_epoll.go
+++ b/src/runtime/netpoll_epoll.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux
// +build linux
package runtime
diff --git a/src/runtime/netpoll_fake.go b/src/runtime/netpoll_fake.go
index b2af3b89b2..8366f28914 100644
--- a/src/runtime/netpoll_fake.go
+++ b/src/runtime/netpoll_fake.go
@@ -5,6 +5,7 @@
// Fake network poller for wasm/js.
// Should never be used, because wasm/js network connections do not honor "SetNonblock".
+//go:build js && wasm
// +build js,wasm
package runtime
diff --git a/src/runtime/netpoll_kqueue.go b/src/runtime/netpoll_kqueue.go
index 3bd93c1f20..80d1b0cf18 100644
--- a/src/runtime/netpoll_kqueue.go
+++ b/src/runtime/netpoll_kqueue.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package runtime
diff --git a/src/runtime/netpoll_stub.go b/src/runtime/netpoll_stub.go
index 3599f2d01b..33ab8eba58 100644
--- a/src/runtime/netpoll_stub.go
+++ b/src/runtime/netpoll_stub.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build plan9
// +build plan9
package runtime
diff --git a/src/runtime/norace_linux_test.go b/src/runtime/norace_linux_test.go
index 3517a5ddbe..94b7c7a467 100644
--- a/src/runtime/norace_linux_test.go
+++ b/src/runtime/norace_linux_test.go
@@ -3,6 +3,7 @@
// license that can be found in the LICENSE file.
// The file contains tests that cannot run under race detector for some reason.
+//go:build !race
// +build !race
package runtime_test
diff --git a/src/runtime/norace_test.go b/src/runtime/norace_test.go
index e90128bb6d..9ad5dde382 100644
--- a/src/runtime/norace_test.go
+++ b/src/runtime/norace_test.go
@@ -3,6 +3,7 @@
// license that can be found in the LICENSE file.
// The file contains tests that cannot run under race detector for some reason.
+//go:build !race
// +build !race
package runtime_test
diff --git a/src/runtime/os_aix.go b/src/runtime/os_aix.go
index 303f0876de..557b17cc75 100644
--- a/src/runtime/os_aix.go
+++ b/src/runtime/os_aix.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix
// +build aix
package runtime
diff --git a/src/runtime/os_freebsd2.go b/src/runtime/os_freebsd2.go
index 6947a05d04..fde6fbf1b1 100644
--- a/src/runtime/os_freebsd2.go
+++ b/src/runtime/os_freebsd2.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build freebsd && !amd64
// +build freebsd,!amd64
package runtime
diff --git a/src/runtime/os_freebsd_noauxv.go b/src/runtime/os_freebsd_noauxv.go
index 01efb9b7c9..8fe0cb6718 100644
--- a/src/runtime/os_freebsd_noauxv.go
+++ b/src/runtime/os_freebsd_noauxv.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build freebsd
-// +build !arm
+//go:build freebsd && !arm
+// +build freebsd,!arm
package runtime
diff --git a/src/runtime/os_js.go b/src/runtime/os_js.go
index 5b2c53795a..52b64e7602 100644
--- a/src/runtime/os_js.go
+++ b/src/runtime/os_js.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build js && wasm
// +build js,wasm
package runtime
diff --git a/src/runtime/os_linux_arm64.go b/src/runtime/os_linux_arm64.go
index c5fd742048..5260f22f57 100644
--- a/src/runtime/os_linux_arm64.go
+++ b/src/runtime/os_linux_arm64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build arm64
// +build arm64
package runtime
diff --git a/src/runtime/os_linux_be64.go b/src/runtime/os_linux_be64.go
index 9860002ee4..806d02fee8 100644
--- a/src/runtime/os_linux_be64.go
+++ b/src/runtime/os_linux_be64.go
@@ -4,6 +4,7 @@
// The standard GNU/Linux sigset type on big-endian 64-bit machines.
+//go:build linux && (ppc64 || s390x)
// +build linux
// +build ppc64 s390x
diff --git a/src/runtime/os_linux_generic.go b/src/runtime/os_linux_generic.go
index e1d0952ddf..fe1973dbde 100644
--- a/src/runtime/os_linux_generic.go
+++ b/src/runtime/os_linux_generic.go
@@ -2,13 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !mips
-// +build !mipsle
-// +build !mips64
-// +build !mips64le
-// +build !s390x
-// +build !ppc64
-// +build linux
+//go:build !mips && !mipsle && !mips64 && !mips64le && !s390x && !ppc64 && linux
+// +build !mips,!mipsle,!mips64,!mips64le,!s390x,!ppc64,linux
package runtime
diff --git a/src/runtime/os_linux_mips64x.go b/src/runtime/os_linux_mips64x.go
index 815a83a04b..bd76442dbd 100644
--- a/src/runtime/os_linux_mips64x.go
+++ b/src/runtime/os_linux_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips64 || mips64le)
// +build linux
// +build mips64 mips64le
diff --git a/src/runtime/os_linux_mipsx.go b/src/runtime/os_linux_mipsx.go
index 00fb02e4bf..ef8b3f7d43 100644
--- a/src/runtime/os_linux_mipsx.go
+++ b/src/runtime/os_linux_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips || mipsle)
// +build linux
// +build mips mipsle
diff --git a/src/runtime/os_linux_noauxv.go b/src/runtime/os_linux_noauxv.go
index 895b4cd5f4..59b5aacaeb 100644
--- a/src/runtime/os_linux_noauxv.go
+++ b/src/runtime/os_linux_noauxv.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build linux
-// +build !arm,!arm64,!mips,!mipsle,!mips64,!mips64le,!s390x,!ppc64,!ppc64le
+//go:build linux && !arm && !arm64 && !mips && !mipsle && !mips64 && !mips64le && !s390x && !ppc64 && !ppc64le
+// +build linux,!arm,!arm64,!mips,!mipsle,!mips64,!mips64le,!s390x,!ppc64,!ppc64le
package runtime
diff --git a/src/runtime/os_linux_novdso.go b/src/runtime/os_linux_novdso.go
index 155f415e71..8104f63627 100644
--- a/src/runtime/os_linux_novdso.go
+++ b/src/runtime/os_linux_novdso.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build linux
-// +build !386,!amd64,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le
+//go:build linux && !386 && !amd64 && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le
+// +build linux,!386,!amd64,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le
package runtime
diff --git a/src/runtime/os_linux_ppc64x.go b/src/runtime/os_linux_ppc64x.go
index 3aedc23ef9..c093d2ec0f 100644
--- a/src/runtime/os_linux_ppc64x.go
+++ b/src/runtime/os_linux_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (ppc64 || ppc64le)
// +build linux
// +build ppc64 ppc64le
diff --git a/src/runtime/os_linux_x86.go b/src/runtime/os_linux_x86.go
index d91fa1a0d1..5667774d82 100644
--- a/src/runtime/os_linux_x86.go
+++ b/src/runtime/os_linux_x86.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (386 || amd64)
// +build linux
// +build 386 amd64
diff --git a/src/runtime/os_nonopenbsd.go b/src/runtime/os_nonopenbsd.go
index e65697bdb3..6134b6c02f 100644
--- a/src/runtime/os_nonopenbsd.go
+++ b/src/runtime/os_nonopenbsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !openbsd
// +build !openbsd
package runtime
diff --git a/src/runtime/os_only_solaris.go b/src/runtime/os_only_solaris.go
index e2f5409354..3829683c80 100644
--- a/src/runtime/os_only_solaris.go
+++ b/src/runtime/os_only_solaris.go
@@ -4,6 +4,7 @@
// Solaris code that doesn't also apply to illumos.
+//go:build !illumos
// +build !illumos
package runtime
diff --git a/src/runtime/os_openbsd_libc.go b/src/runtime/os_openbsd_libc.go
index 2edb0358b0..3f43ade558 100644
--- a/src/runtime/os_openbsd_libc.go
+++ b/src/runtime/os_openbsd_libc.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (openbsd && amd64) || (openbsd && arm64)
// +build openbsd,amd64 openbsd,arm64
package runtime
diff --git a/src/runtime/os_openbsd_syscall.go b/src/runtime/os_openbsd_syscall.go
index 16ff2b8e25..6facf31593 100644
--- a/src/runtime/os_openbsd_syscall.go
+++ b/src/runtime/os_openbsd_syscall.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build openbsd,!amd64
-// +build openbsd,!arm64
+//go:build openbsd && !amd64 && openbsd && !arm64
+// +build openbsd,!amd64,openbsd,!arm64
package runtime
diff --git a/src/runtime/os_openbsd_syscall1.go b/src/runtime/os_openbsd_syscall1.go
index f37da04194..0f3d5f0b73 100644
--- a/src/runtime/os_openbsd_syscall1.go
+++ b/src/runtime/os_openbsd_syscall1.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build openbsd && !amd64 && !arm64
// +build openbsd,!amd64,!arm64
package runtime
diff --git a/src/runtime/os_openbsd_syscall2.go b/src/runtime/os_openbsd_syscall2.go
index 81cfb085aa..3b1707126b 100644
--- a/src/runtime/os_openbsd_syscall2.go
+++ b/src/runtime/os_openbsd_syscall2.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build openbsd && !amd64 && !arm64
// +build openbsd,!amd64,!arm64
package runtime
diff --git a/src/runtime/panic32.go b/src/runtime/panic32.go
index aea8401a37..acbdd1ff45 100644
--- a/src/runtime/panic32.go
+++ b/src/runtime/panic32.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build 386 || arm || mips || mipsle
// +build 386 arm mips mipsle
package runtime
diff --git a/src/runtime/pprof/mprof_test.go b/src/runtime/pprof/mprof_test.go
index c11a45fd69..3ef40d3de7 100644
--- a/src/runtime/pprof/mprof_test.go
+++ b/src/runtime/pprof/mprof_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !js
// +build !js
package pprof
@@ -93,31 +94,31 @@ func TestMemoryProfiler(t *testing.T) {
}{{
stk: []string{"runtime/pprof.allocatePersistent1K", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`%v: %v \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocatePersistent1K\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test\.go:47
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test\.go:82
+# 0x[0-9,a-f]+ runtime/pprof\.allocatePersistent1K\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test\.go:48
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test\.go:83
`, 32*memoryProfilerRun, 1024*memoryProfilerRun, 32*memoryProfilerRun, 1024*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateTransient1M", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient1M\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:24
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:79
+# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient1M\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:25
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:80
`, (1<<10)*memoryProfilerRun, (1<<20)*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateTransient2M", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2M\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:30
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:80
+# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2M\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:31
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:81
`, memoryProfilerRun, (2<<20)*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateTransient2MInline", "runtime/pprof.TestMemoryProfiler"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2MInline\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:34
-# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:81
+# 0x[0-9,a-f]+ runtime/pprof\.allocateTransient2MInline\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:35
+# 0x[0-9,a-f]+ runtime/pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:82
`, memoryProfilerRun, (2<<20)*memoryProfilerRun),
}, {
stk: []string{"runtime/pprof.allocateReflectTransient"},
legacy: fmt.Sprintf(`0: 0 \[%v: %v\] @( 0x[0-9,a-f]+)+
-# 0x[0-9,a-f]+ runtime/pprof\.allocateReflectTransient\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:55
+# 0x[0-9,a-f]+ runtime/pprof\.allocateReflectTransient\+0x[0-9,a-f]+ .*/runtime/pprof/mprof_test.go:56
`, memoryProfilerRun, (2<<20)*memoryProfilerRun),
}}
diff --git a/src/runtime/pprof/pprof_norusage.go b/src/runtime/pprof/pprof_norusage.go
index 6fdcc6cc38..e175dd380c 100644
--- a/src/runtime/pprof/pprof_norusage.go
+++ b/src/runtime/pprof/pprof_norusage.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !darwin && !linux
// +build !darwin,!linux
package pprof
diff --git a/src/runtime/pprof/pprof_rusage.go b/src/runtime/pprof/pprof_rusage.go
index 7954673811..269f21bc2f 100644
--- a/src/runtime/pprof/pprof_rusage.go
+++ b/src/runtime/pprof/pprof_rusage.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || linux
// +build darwin linux
package pprof
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index 14321b0934..1b86dbff5b 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !js
// +build !js
package pprof
diff --git a/src/runtime/preempt_nonwindows.go b/src/runtime/preempt_nonwindows.go
index 3066a1521e..365e86a611 100644
--- a/src/runtime/preempt_nonwindows.go
+++ b/src/runtime/preempt_nonwindows.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !windows
// +build !windows
package runtime
diff --git a/src/runtime/race.go b/src/runtime/race.go
index 79fd21765d..cc8c5db1bd 100644
--- a/src/runtime/race.go
+++ b/src/runtime/race.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build race
// +build race
package runtime
diff --git a/src/runtime/race/output_test.go b/src/runtime/race/output_test.go
index 17dc32013f..4a959d9aba 100644
--- a/src/runtime/race/output_test.go
+++ b/src/runtime/race/output_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build race
// +build race
package race_test
diff --git a/src/runtime/race/race.go b/src/runtime/race/race.go
index d6a14b79e7..fe50900ec8 100644
--- a/src/runtime/race/race.go
+++ b/src/runtime/race/race.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (race && linux && amd64) || (race && freebsd && amd64) || (race && netbsd && amd64) || (race && darwin && amd64) || (race && windows && amd64) || (race && linux && ppc64le) || (race && linux && arm64) || (race && darwin && arm64)
// +build race,linux,amd64 race,freebsd,amd64 race,netbsd,amd64 race,darwin,amd64 race,windows,amd64 race,linux,ppc64le race,linux,arm64 race,darwin,arm64
package race
diff --git a/src/runtime/race/race_linux_test.go b/src/runtime/race/race_linux_test.go
index c00ce4d3df..9c0d48d6bd 100644
--- a/src/runtime/race/race_linux_test.go
+++ b/src/runtime/race/race_linux_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && race
// +build linux,race
package race_test
diff --git a/src/runtime/race/race_test.go b/src/runtime/race/race_test.go
index d433af6bd0..8c880b8570 100644
--- a/src/runtime/race/race_test.go
+++ b/src/runtime/race/race_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build race
// +build race
// This program is used to verify the race detector
diff --git a/src/runtime/race/race_unix_test.go b/src/runtime/race/race_unix_test.go
index 84f0acece6..acd6e47f98 100644
--- a/src/runtime/race/race_unix_test.go
+++ b/src/runtime/race/race_unix_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build race && (darwin || freebsd || linux)
// +build race
// +build darwin freebsd linux
diff --git a/src/runtime/race/race_windows_test.go b/src/runtime/race/race_windows_test.go
index 307a1ea6c0..e490d766dd 100644
--- a/src/runtime/race/race_windows_test.go
+++ b/src/runtime/race/race_windows_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build windows && race
// +build windows,race
package race_test
diff --git a/src/runtime/race/sched_test.go b/src/runtime/race/sched_test.go
index d6bb323cde..e904ebd20d 100644
--- a/src/runtime/race/sched_test.go
+++ b/src/runtime/race/sched_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build race
// +build race
package race_test
diff --git a/src/runtime/race/syso_test.go b/src/runtime/race/syso_test.go
index db846c5d2a..cbce5a8f18 100644
--- a/src/runtime/race/syso_test.go
+++ b/src/runtime/race/syso_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !android && !js && !ppc64le
// +build !android,!js,!ppc64le
// Note: we don't run on Android or ppc64 because if there is any non-race test
diff --git a/src/runtime/race/timer_test.go b/src/runtime/race/timer_test.go
index a6c34a8352..f11f8456a0 100644
--- a/src/runtime/race/timer_test.go
+++ b/src/runtime/race/timer_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build race
// +build race
package race_test
diff --git a/src/runtime/race0.go b/src/runtime/race0.go
index 180f707b1a..0e431b8103 100644
--- a/src/runtime/race0.go
+++ b/src/runtime/race0.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !race
// +build !race
// Dummy race detection API, used when not built with -race.
diff --git a/src/runtime/relax_stub.go b/src/runtime/relax_stub.go
index 81ed1291b8..5b92879c20 100644
--- a/src/runtime/relax_stub.go
+++ b/src/runtime/relax_stub.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !windows
// +build !windows
package runtime
diff --git a/src/runtime/runtime_mmap_test.go b/src/runtime/runtime_mmap_test.go
index bb0b747606..f71f8afa57 100644
--- a/src/runtime/runtime_mmap_test.go
+++ b/src/runtime/runtime_mmap_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package runtime_test
diff --git a/src/runtime/runtime_unix_test.go b/src/runtime/runtime_unix_test.go
index b0cbbbe3e6..0251c676e6 100644
--- a/src/runtime/runtime_unix_test.go
+++ b/src/runtime/runtime_unix_test.go
@@ -6,6 +6,7 @@
// We need a fast system call to provoke the race,
// and Close(-1) is nearly universally fast.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || plan9
// +build aix darwin dragonfly freebsd linux netbsd openbsd plan9
package runtime_test
diff --git a/src/runtime/semasleep_test.go b/src/runtime/semasleep_test.go
index 9b371b0732..905e932b7d 100644
--- a/src/runtime/semasleep_test.go
+++ b/src/runtime/semasleep_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !plan9 && !windows && !js
// +build !plan9,!windows,!js
package runtime_test
diff --git a/src/runtime/sigaction.go b/src/runtime/sigaction.go
index 3c888579d0..76f37b1b53 100644
--- a/src/runtime/sigaction.go
+++ b/src/runtime/sigaction.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (linux && !amd64 && !arm64) || (freebsd && !amd64)
// +build linux,!amd64,!arm64 freebsd,!amd64
package runtime
diff --git a/src/runtime/signal_386.go b/src/runtime/signal_386.go
index 065aff48d3..5824eaddb5 100644
--- a/src/runtime/signal_386.go
+++ b/src/runtime/signal_386.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build dragonfly || freebsd || linux || netbsd || openbsd
// +build dragonfly freebsd linux netbsd openbsd
package runtime
diff --git a/src/runtime/signal_aix_ppc64.go b/src/runtime/signal_aix_ppc64.go
index c17563e2a5..a0becd431e 100644
--- a/src/runtime/signal_aix_ppc64.go
+++ b/src/runtime/signal_aix_ppc64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix
// +build aix
package runtime
diff --git a/src/runtime/signal_amd64.go b/src/runtime/signal_amd64.go
index 3eeb5e044f..e45fbb4a87 100644
--- a/src/runtime/signal_amd64.go
+++ b/src/runtime/signal_amd64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build amd64 && (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris)
// +build amd64
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
diff --git a/src/runtime/signal_arm.go b/src/runtime/signal_arm.go
index 156d9d384c..4d9c6224a2 100644
--- a/src/runtime/signal_arm.go
+++ b/src/runtime/signal_arm.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build dragonfly || freebsd || linux || netbsd || openbsd
// +build dragonfly freebsd linux netbsd openbsd
package runtime
diff --git a/src/runtime/signal_arm64.go b/src/runtime/signal_arm64.go
index b559b93938..f04750084f 100644
--- a/src/runtime/signal_arm64.go
+++ b/src/runtime/signal_arm64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || freebsd || linux || netbsd || openbsd
// +build darwin freebsd linux netbsd openbsd
package runtime
diff --git a/src/runtime/signal_linux_mips64x.go b/src/runtime/signal_linux_mips64x.go
index b608197d60..f0a75ac3ea 100644
--- a/src/runtime/signal_linux_mips64x.go
+++ b/src/runtime/signal_linux_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips64 || mips64le)
// +build linux
// +build mips64 mips64le
diff --git a/src/runtime/signal_linux_mipsx.go b/src/runtime/signal_linux_mipsx.go
index c88ac4d521..f3969c5aac 100644
--- a/src/runtime/signal_linux_mipsx.go
+++ b/src/runtime/signal_linux_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips || mipsle)
// +build linux
// +build mips mipsle
diff --git a/src/runtime/signal_linux_ppc64x.go b/src/runtime/signal_linux_ppc64x.go
index 97cb26d587..d9d3e55ec2 100644
--- a/src/runtime/signal_linux_ppc64x.go
+++ b/src/runtime/signal_linux_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (ppc64 || ppc64le)
// +build linux
// +build ppc64 ppc64le
diff --git a/src/runtime/signal_mips64x.go b/src/runtime/signal_mips64x.go
index 2a347ff4cb..1616b57027 100644
--- a/src/runtime/signal_mips64x.go
+++ b/src/runtime/signal_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (linux || openbsd) && (mips64 || mips64le)
// +build linux openbsd
// +build mips64 mips64le
diff --git a/src/runtime/signal_mipsx.go b/src/runtime/signal_mipsx.go
index 8c29f59bd1..dcc7f1e9dd 100644
--- a/src/runtime/signal_mipsx.go
+++ b/src/runtime/signal_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips || mipsle)
// +build linux
// +build mips mipsle
diff --git a/src/runtime/signal_ppc64x.go b/src/runtime/signal_ppc64x.go
index 5de93a330a..f2225da9a1 100644
--- a/src/runtime/signal_ppc64x.go
+++ b/src/runtime/signal_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (aix || linux) && (ppc64 || ppc64le)
// +build aix linux
// +build ppc64 ppc64le
diff --git a/src/runtime/signal_riscv64.go b/src/runtime/signal_riscv64.go
index 93363a4746..e6b1b14130 100644
--- a/src/runtime/signal_riscv64.go
+++ b/src/runtime/signal_riscv64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && riscv64
// +build linux,riscv64
package runtime
diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go
index 3f70707ab4..f2e526973d 100644
--- a/src/runtime/signal_unix.go
+++ b/src/runtime/signal_unix.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package runtime
diff --git a/src/runtime/signal_windows_test.go b/src/runtime/signal_windows_test.go
index 33a9b92ee7..05bc6f8e71 100644
--- a/src/runtime/signal_windows_test.go
+++ b/src/runtime/signal_windows_test.go
@@ -1,3 +1,4 @@
+//go:build windows
// +build windows
package runtime_test
diff --git a/src/runtime/sigqueue.go b/src/runtime/sigqueue.go
index 28b9e26d0f..a282c7aca7 100644
--- a/src/runtime/sigqueue.go
+++ b/src/runtime/sigqueue.go
@@ -28,6 +28,7 @@
// unnecessary rechecks of sig.mask, but it cannot lead to missed signals
// nor deadlocks.
+//go:build !plan9
// +build !plan9
package runtime
diff --git a/src/runtime/sigqueue_note.go b/src/runtime/sigqueue_note.go
index 16aeeb2ef0..e23446bea4 100644
--- a/src/runtime/sigqueue_note.go
+++ b/src/runtime/sigqueue_note.go
@@ -7,8 +7,8 @@
// signal_recv thread. This file holds the non-Darwin implementations of
// those functions. These functions will never be called.
-// +build !darwin
-// +build !plan9
+//go:build !darwin && !plan9
+// +build !darwin,!plan9
package runtime
diff --git a/src/runtime/sigtab_linux_generic.go b/src/runtime/sigtab_linux_generic.go
index 38d686544f..dc1debddab 100644
--- a/src/runtime/sigtab_linux_generic.go
+++ b/src/runtime/sigtab_linux_generic.go
@@ -2,11 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !mips
-// +build !mipsle
-// +build !mips64
-// +build !mips64le
-// +build linux
+//go:build !mips && !mipsle && !mips64 && !mips64le && linux
+// +build !mips,!mipsle,!mips64,!mips64le,linux
package runtime
diff --git a/src/runtime/sigtab_linux_mipsx.go b/src/runtime/sigtab_linux_mipsx.go
index 51ef470ce7..af9c7e56eb 100644
--- a/src/runtime/sigtab_linux_mipsx.go
+++ b/src/runtime/sigtab_linux_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (mips || mipsle || mips64 || mips64le) && linux
// +build mips mipsle mips64 mips64le
// +build linux
diff --git a/src/runtime/stubs2.go b/src/runtime/stubs2.go
index 96096d236b..525b324c81 100644
--- a/src/runtime/stubs2.go
+++ b/src/runtime/stubs2.go
@@ -2,13 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !aix
-// +build !darwin
-// +build !js
-// +build !openbsd
-// +build !plan9
-// +build !solaris
-// +build !windows
+//go:build !aix && !darwin && !js && !openbsd && !plan9 && !solaris && !windows
+// +build !aix,!darwin,!js,!openbsd,!plan9,!solaris,!windows
package runtime
diff --git a/src/runtime/stubs3.go b/src/runtime/stubs3.go
index 1885d32051..b895be4c70 100644
--- a/src/runtime/stubs3.go
+++ b/src/runtime/stubs3.go
@@ -2,12 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !aix
-// +build !darwin
-// +build !freebsd
-// +build !openbsd
-// +build !plan9
-// +build !solaris
+//go:build !aix && !darwin && !freebsd && !openbsd && !plan9 && !solaris
+// +build !aix,!darwin,!freebsd,!openbsd,!plan9,!solaris
package runtime
diff --git a/src/runtime/stubs_linux.go b/src/runtime/stubs_linux.go
index e75fcf6c95..ba267009ca 100644
--- a/src/runtime/stubs_linux.go
+++ b/src/runtime/stubs_linux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux
// +build linux
package runtime
diff --git a/src/runtime/stubs_mips64x.go b/src/runtime/stubs_mips64x.go
index 652e7a9e34..05a4d0d38d 100644
--- a/src/runtime/stubs_mips64x.go
+++ b/src/runtime/stubs_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build mips64 || mips64le
// +build mips64 mips64le
package runtime
diff --git a/src/runtime/stubs_mipsx.go b/src/runtime/stubs_mipsx.go
index 707b295f7a..9bffb35b67 100644
--- a/src/runtime/stubs_mipsx.go
+++ b/src/runtime/stubs_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build mips || mipsle
// +build mips mipsle
package runtime
diff --git a/src/runtime/stubs_nonlinux.go b/src/runtime/stubs_nonlinux.go
index e1ea05cf0b..f9b98595fc 100644
--- a/src/runtime/stubs_nonlinux.go
+++ b/src/runtime/stubs_nonlinux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !linux
// +build !linux
package runtime
diff --git a/src/runtime/stubs_ppc64x.go b/src/runtime/stubs_ppc64x.go
index 26f5bb20ca..0841b413fd 100644
--- a/src/runtime/stubs_ppc64x.go
+++ b/src/runtime/stubs_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ppc64 || ppc64le
// +build ppc64 ppc64le
package runtime
diff --git a/src/runtime/sys_libc.go b/src/runtime/sys_libc.go
index 996c032105..99d073517b 100644
--- a/src/runtime/sys_libc.go
+++ b/src/runtime/sys_libc.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || (openbsd && amd64) || (openbsd && arm64)
// +build darwin openbsd,amd64 openbsd,arm64
package runtime
diff --git a/src/runtime/sys_mips64x.go b/src/runtime/sys_mips64x.go
index cb429c3147..842a4a7084 100644
--- a/src/runtime/sys_mips64x.go
+++ b/src/runtime/sys_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build mips64 || mips64le
// +build mips64 mips64le
package runtime
diff --git a/src/runtime/sys_mipsx.go b/src/runtime/sys_mipsx.go
index 2819218d5f..2038eb7d79 100644
--- a/src/runtime/sys_mipsx.go
+++ b/src/runtime/sys_mipsx.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build mips || mipsle
// +build mips mipsle
package runtime
diff --git a/src/runtime/sys_nonppc64x.go b/src/runtime/sys_nonppc64x.go
index 440937498f..66821b1f76 100644
--- a/src/runtime/sys_nonppc64x.go
+++ b/src/runtime/sys_nonppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !ppc64 && !ppc64le
// +build !ppc64,!ppc64le
package runtime
diff --git a/src/runtime/sys_openbsd.go b/src/runtime/sys_openbsd.go
index fcddf4d6a5..362fa777ef 100644
--- a/src/runtime/sys_openbsd.go
+++ b/src/runtime/sys_openbsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (openbsd && amd64) || (openbsd && arm64)
// +build openbsd,amd64 openbsd,arm64
package runtime
diff --git a/src/runtime/sys_openbsd1.go b/src/runtime/sys_openbsd1.go
index 44c7871ceb..43e0058985 100644
--- a/src/runtime/sys_openbsd1.go
+++ b/src/runtime/sys_openbsd1.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (openbsd && amd64) || (openbsd && arm64)
// +build openbsd,amd64 openbsd,arm64
package runtime
diff --git a/src/runtime/sys_openbsd2.go b/src/runtime/sys_openbsd2.go
index 33032596c3..73157043be 100644
--- a/src/runtime/sys_openbsd2.go
+++ b/src/runtime/sys_openbsd2.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (openbsd && amd64) || (openbsd && arm64)
// +build openbsd,amd64 openbsd,arm64
package runtime
diff --git a/src/runtime/sys_openbsd3.go b/src/runtime/sys_openbsd3.go
index 4d4c88e3ac..751c00c2b3 100644
--- a/src/runtime/sys_openbsd3.go
+++ b/src/runtime/sys_openbsd3.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (openbsd && amd64) || (openbsd && arm64)
// +build openbsd,amd64 openbsd,arm64
package runtime
diff --git a/src/runtime/sys_ppc64x.go b/src/runtime/sys_ppc64x.go
index 796f27c4e3..69bd99fa09 100644
--- a/src/runtime/sys_ppc64x.go
+++ b/src/runtime/sys_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ppc64 || ppc64le
// +build ppc64 ppc64le
package runtime
diff --git a/src/runtime/sys_x86.go b/src/runtime/sys_x86.go
index 8f21585d28..0866e3140e 100644
--- a/src/runtime/sys_x86.go
+++ b/src/runtime/sys_x86.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build amd64 || 386
// +build amd64 386
package runtime
diff --git a/src/runtime/time_fake.go b/src/runtime/time_fake.go
index c64d2994a9..1238744ebf 100644
--- a/src/runtime/time_fake.go
+++ b/src/runtime/time_fake.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build faketime
-// +build !windows
+//go:build faketime && !windows
+// +build faketime,!windows
// Faketime isn't currently supported on Windows. This would require:
//
diff --git a/src/runtime/time_nofake.go b/src/runtime/time_nofake.go
index 1912a94e87..13bf1c2d4f 100644
--- a/src/runtime/time_nofake.go
+++ b/src/runtime/time_nofake.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !faketime
// +build !faketime
package runtime
diff --git a/src/runtime/timeasm.go b/src/runtime/timeasm.go
index 82cf63edff..fe38a086fc 100644
--- a/src/runtime/timeasm.go
+++ b/src/runtime/timeasm.go
@@ -4,6 +4,7 @@
// Declarations for operating systems implementing time.now directly in assembly.
+//go:build windows
// +build windows
package runtime
diff --git a/src/runtime/timestub.go b/src/runtime/timestub.go
index 459bf8e543..2ef8d4665f 100644
--- a/src/runtime/timestub.go
+++ b/src/runtime/timestub.go
@@ -5,6 +5,7 @@
// Declarations for operating systems implementing time.now
// indirectly, in terms of walltime and nanotime assembly.
+//go:build !windows
// +build !windows
package runtime
diff --git a/src/runtime/timestub2.go b/src/runtime/timestub2.go
index 68777ee4a9..53b10885af 100644
--- a/src/runtime/timestub2.go
+++ b/src/runtime/timestub2.go
@@ -2,12 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !aix
-// +build !darwin
-// +build !freebsd
-// +build !openbsd
-// +build !solaris
-// +build !windows
+//go:build !aix && !darwin && !freebsd && !openbsd && !solaris && !windows
+// +build !aix,!darwin,!freebsd,!openbsd,!solaris,!windows
package runtime
diff --git a/src/runtime/vdso_elf32.go b/src/runtime/vdso_elf32.go
index 2720f33eed..456173b0f5 100644
--- a/src/runtime/vdso_elf32.go
+++ b/src/runtime/vdso_elf32.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (386 || arm)
// +build linux
// +build 386 arm
diff --git a/src/runtime/vdso_elf64.go b/src/runtime/vdso_elf64.go
index 6ded9d621a..9923bd4697 100644
--- a/src/runtime/vdso_elf64.go
+++ b/src/runtime/vdso_elf64.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (amd64 || arm64 || mips64 || mips64le || ppc64 || ppc64le)
// +build linux
// +build amd64 arm64 mips64 mips64le ppc64 ppc64le
diff --git a/src/runtime/vdso_freebsd.go b/src/runtime/vdso_freebsd.go
index 122cc8b128..74b2f1435a 100644
--- a/src/runtime/vdso_freebsd.go
+++ b/src/runtime/vdso_freebsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build freebsd
// +build freebsd
package runtime
diff --git a/src/runtime/vdso_freebsd_x86.go b/src/runtime/vdso_freebsd_x86.go
index 1fa5d80dcc..23a5a8c322 100644
--- a/src/runtime/vdso_freebsd_x86.go
+++ b/src/runtime/vdso_freebsd_x86.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build freebsd && (386 || amd64)
// +build freebsd
// +build 386 amd64
diff --git a/src/runtime/vdso_in_none.go b/src/runtime/vdso_in_none.go
index 7f4019c0d6..c66fbf8216 100644
--- a/src/runtime/vdso_in_none.go
+++ b/src/runtime/vdso_in_none.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (linux && !386 && !amd64 && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le) || !linux
// +build linux,!386,!amd64,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le !linux
package runtime
diff --git a/src/runtime/vdso_linux.go b/src/runtime/vdso_linux.go
index 6e2942498d..ae211f96b1 100644
--- a/src/runtime/vdso_linux.go
+++ b/src/runtime/vdso_linux.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (386 || amd64 || arm || arm64 || mips64 || mips64le || ppc64 || ppc64le)
// +build linux
// +build 386 amd64 arm arm64 mips64 mips64le ppc64 ppc64le
diff --git a/src/runtime/vdso_linux_mips64x.go b/src/runtime/vdso_linux_mips64x.go
index 3a0f947612..395ddbba69 100644
--- a/src/runtime/vdso_linux_mips64x.go
+++ b/src/runtime/vdso_linux_mips64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (mips64 || mips64le)
// +build linux
// +build mips64 mips64le
diff --git a/src/runtime/vdso_linux_ppc64x.go b/src/runtime/vdso_linux_ppc64x.go
index f30946e4c5..b741dbfcdc 100644
--- a/src/runtime/vdso_linux_ppc64x.go
+++ b/src/runtime/vdso_linux_ppc64x.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux && (ppc64 || ppc64le)
// +build linux
// +build ppc64 ppc64le
diff --git a/src/runtime/vlrt.go b/src/runtime/vlrt.go
index 996c0611fd..cf631bdcca 100644
--- a/src/runtime/vlrt.go
+++ b/src/runtime/vlrt.go
@@ -23,6 +23,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+//go:build arm || 386 || mips || mipsle
// +build arm 386 mips mipsle
package runtime
diff --git a/src/runtime/wincallback.go b/src/runtime/wincallback.go
index cf3327c6fe..56f0674f4e 100644
--- a/src/runtime/wincallback.go
+++ b/src/runtime/wincallback.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
// Generate Windows callback assembly file.
diff --git a/src/runtime/write_err.go b/src/runtime/write_err.go
index 6b1467b1c4..a4656fd728 100644
--- a/src/runtime/write_err.go
+++ b/src/runtime/write_err.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !android
// +build !android
package runtime