aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
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/crypto
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/crypto')
-rw-r--r--src/crypto/aes/aes_gcm.go1
-rw-r--r--src/crypto/aes/cipher_asm.go1
-rw-r--r--src/crypto/aes/cipher_generic.go1
-rw-r--r--src/crypto/aes/gcm_ppc64le.go1
-rw-r--r--src/crypto/cipher/xor_generic.go1
-rw-r--r--src/crypto/cipher/xor_ppc64x.go1
-rw-r--r--src/crypto/ecdsa/ecdsa_noasm.go1
-rw-r--r--src/crypto/ecdsa/ecdsa_s390x_test.go1
-rw-r--r--src/crypto/elliptic/fuzz_test.go1
-rw-r--r--src/crypto/elliptic/p256.go1
-rw-r--r--src/crypto/elliptic/p256_asm.go1
-rw-r--r--src/crypto/elliptic/p256_generic.go1
-rw-r--r--src/crypto/elliptic/p256_ppc64le.go1
-rw-r--r--src/crypto/elliptic/p256_s390x.go1
-rw-r--r--src/crypto/internal/subtle/aliasing.go1
-rw-r--r--src/crypto/internal/subtle/aliasing_appengine.go1
-rw-r--r--src/crypto/md5/gen.go1
-rw-r--r--src/crypto/md5/md5block_decl.go1
-rw-r--r--src/crypto/md5/md5block_generic.go1
-rw-r--r--src/crypto/rand/eagain.go1
-rw-r--r--src/crypto/rand/rand_batched.go1
-rw-r--r--src/crypto/rand/rand_batched_test.go1
-rw-r--r--src/crypto/rand/rand_js.go1
-rw-r--r--src/crypto/rand/rand_unix.go1
-rw-r--r--src/crypto/sha1/fallback_test.go1
-rw-r--r--src/crypto/sha1/issue15617_test.go1
-rw-r--r--src/crypto/sha1/sha1block_decl.go1
-rw-r--r--src/crypto/sha1/sha1block_generic.go1
-rw-r--r--src/crypto/sha256/fallback_test.go1
-rw-r--r--src/crypto/sha256/sha256block_decl.go1
-rw-r--r--src/crypto/sha256/sha256block_generic.go1
-rw-r--r--src/crypto/sha512/fallback_test.go1
-rw-r--r--src/crypto/sha512/sha512block_amd64.go1
-rw-r--r--src/crypto/sha512/sha512block_decl.go1
-rw-r--r--src/crypto/sha512/sha512block_generic.go1
-rw-r--r--src/crypto/tls/generate_cert.go1
-rw-r--r--src/crypto/tls/handshake_unix_test.go1
-rw-r--r--src/crypto/x509/internal/macos/corefoundation.go1
-rw-r--r--src/crypto/x509/internal/macos/security.go1
-rw-r--r--src/crypto/x509/root_bsd.go1
-rw-r--r--src/crypto/x509/root_darwin.go1
-rw-r--r--src/crypto/x509/root_ios.go4
-rw-r--r--src/crypto/x509/root_ios_gen.go1
-rw-r--r--src/crypto/x509/root_js.go1
-rw-r--r--src/crypto/x509/root_omit.go1
-rw-r--r--src/crypto/x509/root_omit_test.go1
-rw-r--r--src/crypto/x509/root_plan9.go1
-rw-r--r--src/crypto/x509/root_unix.go1
-rw-r--r--src/crypto/x509/root_unix_test.go1
-rw-r--r--src/crypto/x509/x509_test_import.go1
50 files changed, 51 insertions, 2 deletions
diff --git a/src/crypto/aes/aes_gcm.go b/src/crypto/aes/aes_gcm.go
index 49b78c3a8b..1de0e457a2 100644
--- a/src/crypto/aes/aes_gcm.go
+++ b/src/crypto/aes/aes_gcm.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
// +build amd64 arm64
package aes
diff --git a/src/crypto/aes/cipher_asm.go b/src/crypto/aes/cipher_asm.go
index 646bdfa5c0..4251805ef9 100644
--- a/src/crypto/aes/cipher_asm.go
+++ b/src/crypto/aes/cipher_asm.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
// +build amd64 arm64
package aes
diff --git a/src/crypto/aes/cipher_generic.go b/src/crypto/aes/cipher_generic.go
index 80a68b4ef0..22ce3be7f3 100644
--- a/src/crypto/aes/cipher_generic.go
+++ b/src/crypto/aes/cipher_generic.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 && !s390x && !ppc64le && !arm64
// +build !amd64,!s390x,!ppc64le,!arm64
package aes
diff --git a/src/crypto/aes/gcm_ppc64le.go b/src/crypto/aes/gcm_ppc64le.go
index 084edddc4d..01b4e08757 100644
--- a/src/crypto/aes/gcm_ppc64le.go
+++ b/src/crypto/aes/gcm_ppc64le.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 ppc64le
// +build ppc64le
package aes
diff --git a/src/crypto/cipher/xor_generic.go b/src/crypto/cipher/xor_generic.go
index ca9c4bbf39..03208402d7 100644
--- a/src/crypto/cipher/xor_generic.go
+++ b/src/crypto/cipher/xor_generic.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 && !ppc64 && !ppc64le && !arm64
// +build !amd64,!ppc64,!ppc64le,!arm64
package cipher
diff --git a/src/crypto/cipher/xor_ppc64x.go b/src/crypto/cipher/xor_ppc64x.go
index 8d2e43d327..f520208a37 100644
--- a/src/crypto/cipher/xor_ppc64x.go
+++ b/src/crypto/cipher/xor_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 cipher
diff --git a/src/crypto/ecdsa/ecdsa_noasm.go b/src/crypto/ecdsa/ecdsa_noasm.go
index 72196211e5..68670a4f93 100644
--- a/src/crypto/ecdsa/ecdsa_noasm.go
+++ b/src/crypto/ecdsa/ecdsa_noasm.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 !s390x
// +build !s390x
package ecdsa
diff --git a/src/crypto/ecdsa/ecdsa_s390x_test.go b/src/crypto/ecdsa/ecdsa_s390x_test.go
index a434575dbc..e8b16b3668 100644
--- a/src/crypto/ecdsa/ecdsa_s390x_test.go
+++ b/src/crypto/ecdsa/ecdsa_s390x_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 s390x
// +build s390x
package ecdsa
diff --git a/src/crypto/elliptic/fuzz_test.go b/src/crypto/elliptic/fuzz_test.go
index b9209a789b..f5c9841a12 100644
--- a/src/crypto/elliptic/fuzz_test.go
+++ b/src/crypto/elliptic/fuzz_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 amd64 || arm64 || ppc64le
// +build amd64 arm64 ppc64le
package elliptic
diff --git a/src/crypto/elliptic/p256.go b/src/crypto/elliptic/p256.go
index c23e414156..3bb7bb70b6 100644
--- a/src/crypto/elliptic/p256.go
+++ b/src/crypto/elliptic/p256.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
// +build !amd64,!arm64
package elliptic
diff --git a/src/crypto/elliptic/p256_asm.go b/src/crypto/elliptic/p256_asm.go
index 6cf7742e1b..c405718b5e 100644
--- a/src/crypto/elliptic/p256_asm.go
+++ b/src/crypto/elliptic/p256_asm.go
@@ -10,6 +10,7 @@
// https://link.springer.com/article/10.1007%2Fs13389-014-0090-x
// https://eprint.iacr.org/2013/816.pdf
+//go:build amd64 || arm64
// +build amd64 arm64
package elliptic
diff --git a/src/crypto/elliptic/p256_generic.go b/src/crypto/elliptic/p256_generic.go
index f74c607a88..8ad56638e9 100644
--- a/src/crypto/elliptic/p256_generic.go
+++ b/src/crypto/elliptic/p256_generic.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 && !s390x && !arm64 && !ppc64le
// +build !amd64,!s390x,!arm64,!ppc64le
package elliptic
diff --git a/src/crypto/elliptic/p256_ppc64le.go b/src/crypto/elliptic/p256_ppc64le.go
index 160bdb12e3..40d9ed9d40 100644
--- a/src/crypto/elliptic/p256_ppc64le.go
+++ b/src/crypto/elliptic/p256_ppc64le.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 ppc64le
// +build ppc64le
package elliptic
diff --git a/src/crypto/elliptic/p256_s390x.go b/src/crypto/elliptic/p256_s390x.go
index 0d9478bfd6..91e613b631 100644
--- a/src/crypto/elliptic/p256_s390x.go
+++ b/src/crypto/elliptic/p256_s390x.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 s390x
// +build s390x
package elliptic
diff --git a/src/crypto/internal/subtle/aliasing.go b/src/crypto/internal/subtle/aliasing.go
index 812ce3c655..86e0f3cfe7 100644
--- a/src/crypto/internal/subtle/aliasing.go
+++ b/src/crypto/internal/subtle/aliasing.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 !appengine
// +build !appengine
// Package subtle implements functions that are often useful in cryptographic
diff --git a/src/crypto/internal/subtle/aliasing_appengine.go b/src/crypto/internal/subtle/aliasing_appengine.go
index 844f901d18..35b442f7a2 100644
--- a/src/crypto/internal/subtle/aliasing_appengine.go
+++ b/src/crypto/internal/subtle/aliasing_appengine.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 appengine
// +build appengine
// Package subtle implements functions that are often useful in cryptographic
diff --git a/src/crypto/md5/gen.go b/src/crypto/md5/gen.go
index 1468924cbc..29729fad01 100644
--- a/src/crypto/md5/gen.go
+++ b/src/crypto/md5/gen.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
// This program generates md5block.go
diff --git a/src/crypto/md5/md5block_decl.go b/src/crypto/md5/md5block_decl.go
index f251e03d7f..bc2d58c069 100644
--- a/src/crypto/md5/md5block_decl.go
+++ b/src/crypto/md5/md5block_decl.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 || arm || ppc64le || ppc64 || s390x || arm64
// +build amd64 386 arm ppc64le ppc64 s390x arm64
package md5
diff --git a/src/crypto/md5/md5block_generic.go b/src/crypto/md5/md5block_generic.go
index 0b46e70b60..ea4fbcd0b4 100644
--- a/src/crypto/md5/md5block_generic.go
+++ b/src/crypto/md5/md5block_generic.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 && !arm && !ppc64le && !ppc64 && !s390x && !arm64
// +build !amd64,!386,!arm,!ppc64le,!ppc64,!s390x,!arm64
package md5
diff --git a/src/crypto/rand/eagain.go b/src/crypto/rand/eagain.go
index c9499715dc..85d4d9d47f 100644
--- a/src/crypto/rand/eagain.go
+++ b/src/crypto/rand/eagain.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 rand
diff --git a/src/crypto/rand/rand_batched.go b/src/crypto/rand/rand_batched.go
index 60267fd4bc..45e9351a31 100644
--- a/src/crypto/rand/rand_batched.go
+++ b/src/crypto/rand/rand_batched.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 || freebsd
// +build linux freebsd
package rand
diff --git a/src/crypto/rand/rand_batched_test.go b/src/crypto/rand/rand_batched_test.go
index 837db83f77..fd50735c7d 100644
--- a/src/crypto/rand/rand_batched_test.go
+++ b/src/crypto/rand/rand_batched_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 || freebsd
// +build linux freebsd
package rand
diff --git a/src/crypto/rand/rand_js.go b/src/crypto/rand/rand_js.go
index 7e939742ac..7ddc2b6169 100644
--- a/src/crypto/rand/rand_js.go
+++ b/src/crypto/rand/rand_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 rand
diff --git a/src/crypto/rand/rand_unix.go b/src/crypto/rand/rand_unix.go
index 548a5e4cb9..81277eb6a5 100644
--- a/src/crypto/rand/rand_unix.go
+++ b/src/crypto/rand/rand_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 || plan9 || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd plan9 solaris
// Unix cryptographically secure pseudorandom number
diff --git a/src/crypto/sha1/fallback_test.go b/src/crypto/sha1/fallback_test.go
index 08acd044d0..4bb8b3324f 100644
--- a/src/crypto/sha1/fallback_test.go
+++ b/src/crypto/sha1/fallback_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 s390x
// +build s390x
package sha1
diff --git a/src/crypto/sha1/issue15617_test.go b/src/crypto/sha1/issue15617_test.go
index 98038e5807..436f78c745 100644
--- a/src/crypto/sha1/issue15617_test.go
+++ b/src/crypto/sha1/issue15617_test.go
@@ -1,3 +1,4 @@
+//go:build amd64 && (linux || darwin)
// +build amd64
// +build linux darwin
diff --git a/src/crypto/sha1/sha1block_decl.go b/src/crypto/sha1/sha1block_decl.go
index 9c7df4e40a..93054efa7c 100644
--- a/src/crypto/sha1/sha1block_decl.go
+++ b/src/crypto/sha1/sha1block_decl.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 || 386 || s390x
// +build arm 386 s390x
package sha1
diff --git a/src/crypto/sha1/sha1block_generic.go b/src/crypto/sha1/sha1block_generic.go
index f95ea0eee4..feaba5a23a 100644
--- a/src/crypto/sha1/sha1block_generic.go
+++ b/src/crypto/sha1/sha1block_generic.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 && !arm && !s390x && !arm64
// +build !amd64,!386,!arm,!s390x,!arm64
package sha1
diff --git a/src/crypto/sha256/fallback_test.go b/src/crypto/sha256/fallback_test.go
index 5917a4862a..7ce88cbb2a 100644
--- a/src/crypto/sha256/fallback_test.go
+++ b/src/crypto/sha256/fallback_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 s390x
// +build s390x
package sha256
diff --git a/src/crypto/sha256/sha256block_decl.go b/src/crypto/sha256/sha256block_decl.go
index fe07e53b84..a6bb396f13 100644
--- a/src/crypto/sha256/sha256block_decl.go
+++ b/src/crypto/sha256/sha256block_decl.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 || amd64 || s390x || ppc64le
// +build 386 amd64 s390x ppc64le
package sha256
diff --git a/src/crypto/sha256/sha256block_generic.go b/src/crypto/sha256/sha256block_generic.go
index 61362f4126..620c048b93 100644
--- a/src/crypto/sha256/sha256block_generic.go
+++ b/src/crypto/sha256/sha256block_generic.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 && !s390x && !ppc64le && !arm64
// +build !amd64,!386,!s390x,!ppc64le,!arm64
package sha256
diff --git a/src/crypto/sha512/fallback_test.go b/src/crypto/sha512/fallback_test.go
index 9024ce668a..faf732670a 100644
--- a/src/crypto/sha512/fallback_test.go
+++ b/src/crypto/sha512/fallback_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 s390x
// +build s390x
package sha512
diff --git a/src/crypto/sha512/sha512block_amd64.go b/src/crypto/sha512/sha512block_amd64.go
index 18151cea24..e2386f29ab 100644
--- a/src/crypto/sha512/sha512block_amd64.go
+++ b/src/crypto/sha512/sha512block_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
// +build amd64
package sha512
diff --git a/src/crypto/sha512/sha512block_decl.go b/src/crypto/sha512/sha512block_decl.go
index 613d1e02a3..6c22f44801 100644
--- a/src/crypto/sha512/sha512block_decl.go
+++ b/src/crypto/sha512/sha512block_decl.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 s390x || ppc64le
// +build s390x ppc64le
package sha512
diff --git a/src/crypto/sha512/sha512block_generic.go b/src/crypto/sha512/sha512block_generic.go
index 3eabd2c7c0..865a7356f1 100644
--- a/src/crypto/sha512/sha512block_generic.go
+++ b/src/crypto/sha512/sha512block_generic.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 && !s390x && !ppc64le
// +build !amd64,!s390x,!ppc64le
package sha512
diff --git a/src/crypto/tls/generate_cert.go b/src/crypto/tls/generate_cert.go
index 1857185fe4..7ea90f8a7b 100644
--- a/src/crypto/tls/generate_cert.go
+++ b/src/crypto/tls/generate_cert.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 a self-signed X.509 certificate for a TLS server. Outputs to
diff --git a/src/crypto/tls/handshake_unix_test.go b/src/crypto/tls/handshake_unix_test.go
index 72718544ae..19fc698676 100644
--- a/src/crypto/tls/handshake_unix_test.go
+++ b/src/crypto/tls/handshake_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 tls
diff --git a/src/crypto/x509/internal/macos/corefoundation.go b/src/crypto/x509/internal/macos/corefoundation.go
index 0572c6ccd8..abcdcdd91e 100644
--- a/src/crypto/x509/internal/macos/corefoundation.go
+++ b/src/crypto/x509/internal/macos/corefoundation.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 && !ios
// +build darwin,!ios
// Package macOS provides cgo-less wrappers for Core Foundation and
diff --git a/src/crypto/x509/internal/macos/security.go b/src/crypto/x509/internal/macos/security.go
index 3163e3a4f7..f346ff4c7f 100644
--- a/src/crypto/x509/internal/macos/security.go
+++ b/src/crypto/x509/internal/macos/security.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 && !ios
// +build darwin,!ios
package macOS
diff --git a/src/crypto/x509/root_bsd.go b/src/crypto/x509/root_bsd.go
index f04b6bd0d6..822e8573ff 100644
--- a/src/crypto/x509/root_bsd.go
+++ b/src/crypto/x509/root_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
// +build dragonfly freebsd netbsd openbsd
package x509
diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go
index c9ea7e80f3..05593bb105 100644
--- a/src/crypto/x509/root_darwin.go
+++ b/src/crypto/x509/root_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 !ios
// +build !ios
package x509
diff --git a/src/crypto/x509/root_ios.go b/src/crypto/x509/root_ios.go
index d2dfb62b77..50432f3d2c 100644
--- a/src/crypto/x509/root_ios.go
+++ b/src/crypto/x509/root_ios.go
@@ -1,8 +1,8 @@
// Code generated by root_ios_gen.go -version 55188.40.9; DO NOT EDIT.
// Update the version in root.go and regenerate with "go generate".
-// +build ios
-// +build !x509omitbundledroots
+//go:build ios && !x509omitbundledroots
+// +build ios,!x509omitbundledroots
package x509
diff --git a/src/crypto/x509/root_ios_gen.go b/src/crypto/x509/root_ios_gen.go
index 8bc6e7d9c4..05bd672d5d 100644
--- a/src/crypto/x509/root_ios_gen.go
+++ b/src/crypto/x509/root_ios_gen.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
// Generates root_ios.go.
diff --git a/src/crypto/x509/root_js.go b/src/crypto/x509/root_js.go
index 4e537a4fe5..f2c2c0af38 100644
--- a/src/crypto/x509/root_js.go
+++ b/src/crypto/x509/root_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 x509
diff --git a/src/crypto/x509/root_omit.go b/src/crypto/x509/root_omit.go
index 0055b3b862..81f2f112d0 100644
--- a/src/crypto/x509/root_omit.go
+++ b/src/crypto/x509/root_omit.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 && arm64) || (darwin && amd64 && ios)) && x509omitbundledroots
// +build darwin,arm64 darwin,amd64,ios
// +build x509omitbundledroots
diff --git a/src/crypto/x509/root_omit_test.go b/src/crypto/x509/root_omit_test.go
index 5ab6c931de..158bd7f91a 100644
--- a/src/crypto/x509/root_omit_test.go
+++ b/src/crypto/x509/root_omit_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 ((darwin && arm64) || (darwin && amd64 && ios)) && x509omitbundledroots
// +build darwin,arm64 darwin,amd64,ios
// +build x509omitbundledroots
diff --git a/src/crypto/x509/root_plan9.go b/src/crypto/x509/root_plan9.go
index 2dc4aaf5d7..2bdb2fe713 100644
--- a/src/crypto/x509/root_plan9.go
+++ b/src/crypto/x509/root_plan9.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 x509
diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go
index 262fc079d5..dede825edd 100644
--- a/src/crypto/x509/root_unix.go
+++ b/src/crypto/x509/root_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 || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris
// +build aix dragonfly freebsd js,wasm linux netbsd openbsd solaris
package x509
diff --git a/src/crypto/x509/root_unix_test.go b/src/crypto/x509/root_unix_test.go
index 878ed7c2fa..38038a65f3 100644
--- a/src/crypto/x509/root_unix_test.go
+++ b/src/crypto/x509/root_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 || solaris
// +build dragonfly freebsd linux netbsd openbsd solaris
package x509
diff --git a/src/crypto/x509/x509_test_import.go b/src/crypto/x509/x509_test_import.go
index b778df261a..ef3ee807bf 100644
--- a/src/crypto/x509/x509_test_import.go
+++ b/src/crypto/x509/x509_test_import.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
// This file is run by the x509 tests to ensure that a program with minimal