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>
diff --git a/src/net/addrselect.go b/src/net/addrselect.go
index 7c0dfe2..ae93c59 100644
--- a/src/net/addrselect.go
+++ b/src/net/addrselect.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
// Minimal RFC 6724 address selection.
diff --git a/src/net/addrselect_test.go b/src/net/addrselect_test.go
index d6e0e63..dc13917 100644
--- a/src/net/addrselect_test.go
+++ b/src/net/addrselect_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 || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package net
diff --git a/src/net/cgo_aix.go b/src/net/cgo_aix.go
index d0ad414..a94405e 100644
--- a/src/net/cgo_aix.go
+++ b/src/net/cgo_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 cgo && !netgo
// +build cgo,!netgo
package net
diff --git a/src/net/cgo_android.go b/src/net/cgo_android.go
index ab0368d..4b1a2e3 100644
--- a/src/net/cgo_android.go
+++ b/src/net/cgo_android.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 && !netgo
// +build cgo,!netgo
package net
diff --git a/src/net/cgo_bsd.go b/src/net/cgo_bsd.go
index a923c55..23be721 100644
--- a/src/net/cgo_bsd.go
+++ b/src/net/cgo_bsd.go
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build cgo,!netgo
+//go:build cgo && !netgo && (darwin || dragonfly || freebsd)
+// +build cgo
+// +build !netgo
// +build darwin dragonfly freebsd
package net
diff --git a/src/net/cgo_linux.go b/src/net/cgo_linux.go
index 86d8f4d..1bd6be9 100644
--- a/src/net/cgo_linux.go
+++ b/src/net/cgo_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 !android && cgo && !netgo
// +build !android,cgo,!netgo
package net
diff --git a/src/net/cgo_netbsd.go b/src/net/cgo_netbsd.go
index 4610246..3714793 100644
--- a/src/net/cgo_netbsd.go
+++ b/src/net/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 cgo && !netgo
// +build cgo,!netgo
package net
diff --git a/src/net/cgo_openbsd.go b/src/net/cgo_openbsd.go
index 4610246..3714793 100644
--- a/src/net/cgo_openbsd.go
+++ b/src/net/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 cgo && !netgo
// +build cgo,!netgo
package net
diff --git a/src/net/cgo_resnew.go b/src/net/cgo_resnew.go
index 3e3e77e..1544052 100644
--- a/src/net/cgo_resnew.go
+++ b/src/net/cgo_resnew.go
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build cgo,!netgo
+//go:build cgo && !netgo && (darwin || (linux && !android) || netbsd || solaris)
+// +build cgo
+// +build !netgo
// +build darwin linux,!android netbsd solaris
package net
diff --git a/src/net/cgo_resold.go b/src/net/cgo_resold.go
index abd04a8..c4aab33 100644
--- a/src/net/cgo_resold.go
+++ b/src/net/cgo_resold.go
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build cgo,!netgo
+//go:build cgo && !netgo && (android || freebsd || dragonfly || openbsd)
+// +build cgo
+// +build !netgo
// +build android freebsd dragonfly openbsd
package net
diff --git a/src/net/cgo_socknew.go b/src/net/cgo_socknew.go
index 3b13926..f9cfad9 100644
--- a/src/net/cgo_socknew.go
+++ b/src/net/cgo_socknew.go
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build cgo,!netgo
+//go:build cgo && !netgo && (android || linux || solaris)
+// +build cgo
+// +build !netgo
// +build android linux solaris
package net
diff --git a/src/net/cgo_sockold.go b/src/net/cgo_sockold.go
index e1e642b..22c6725 100644
--- a/src/net/cgo_sockold.go
+++ b/src/net/cgo_sockold.go
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build cgo,!netgo
+//go:build cgo && !netgo && (aix || darwin || dragonfly || freebsd || netbsd || openbsd)
+// +build cgo
+// +build !netgo
// +build aix darwin dragonfly freebsd netbsd openbsd
package net
diff --git a/src/net/cgo_solaris.go b/src/net/cgo_solaris.go
index 25c0721..a84f5b0 100644
--- a/src/net/cgo_solaris.go
+++ b/src/net/cgo_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 cgo && !netgo
// +build cgo,!netgo
package net
diff --git a/src/net/cgo_stub.go b/src/net/cgo_stub.go
index 041f8af..039e4be 100644
--- a/src/net/cgo_stub.go
+++ b/src/net/cgo_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 !cgo || netgo
// +build !cgo netgo
package net
diff --git a/src/net/cgo_unix.go b/src/net/cgo_unix.go
index 69c99fe..2ea86e0 100644
--- a/src/net/cgo_unix.go
+++ b/src/net/cgo_unix.go
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build cgo,!netgo
+//go:build cgo && !netgo && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris)
+// +build cgo
+// +build !netgo
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package net
diff --git a/src/net/cgo_unix_test.go b/src/net/cgo_unix_test.go
index 99d79a6..1f3d9ea 100644
--- a/src/net/cgo_unix_test.go
+++ b/src/net/cgo_unix_test.go
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build cgo,!netgo
+//go:build cgo && !netgo && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris)
+// +build cgo
+// +build !netgo
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package net
diff --git a/src/net/cgo_windows.go b/src/net/cgo_windows.go
index 8968b75..1fd1f29 100644
--- a/src/net/cgo_windows.go
+++ b/src/net/cgo_windows.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 && !netgo
// +build cgo,!netgo
package net
diff --git a/src/net/conf.go b/src/net/conf.go
index f1bbfed..6b9569c 100644
--- a/src/net/conf.go
+++ b/src/net/conf.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 net
diff --git a/src/net/conf_netcgo.go b/src/net/conf_netcgo.go
index db4c703..8f387eb 100644
--- a/src/net/conf_netcgo.go
+++ b/src/net/conf_netcgo.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 netcgo
// +build netcgo
package net
diff --git a/src/net/conf_test.go b/src/net/conf_test.go
index 1fe3cf4..b1f2c55 100644
--- a/src/net/conf_test.go
+++ b/src/net/conf_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 || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package net
diff --git a/src/net/conn_test.go b/src/net/conn_test.go
index 771cabc..45e271c 100644
--- a/src/net/conn_test.go
+++ b/src/net/conn_test.go
@@ -5,6 +5,7 @@
// This file implements API tests across platforms and will never have a build
// tag.
+//go:build !js
// +build !js
package net
diff --git a/src/net/dial_test.go b/src/net/dial_test.go
index 57cf555..394bdb0 100644
--- a/src/net/dial_test.go
+++ b/src/net/dial_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 net
diff --git a/src/net/dial_unix_test.go b/src/net/dial_unix_test.go
index 3cfc9d8..108b973 100644
--- a/src/net/dial_unix_test.go
+++ b/src/net/dial_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 net
diff --git a/src/net/dnsclient_unix.go b/src/net/dnsclient_unix.go
index d7db0c8..a3242ff 100644
--- a/src/net/dnsclient_unix.go
+++ b/src/net/dnsclient_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
// DNS client: see RFC 1035.
diff --git a/src/net/dnsclient_unix_test.go b/src/net/dnsclient_unix_test.go
index 0530c92..b47b83a 100644
--- a/src/net/dnsclient_unix_test.go
+++ b/src/net/dnsclient_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 net
diff --git a/src/net/dnsconfig_unix.go b/src/net/dnsconfig_unix.go
index 877e77c..db9213a 100644
--- a/src/net/dnsconfig_unix.go
+++ b/src/net/dnsconfig_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
// Read system DNS config from /etc/resolv.conf
diff --git a/src/net/dnsconfig_unix_test.go b/src/net/dnsconfig_unix_test.go
index 0d7897a..0e2317c 100644
--- a/src/net/dnsconfig_unix_test.go
+++ b/src/net/dnsconfig_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 net
diff --git a/src/net/dnsname_test.go b/src/net/dnsname_test.go
index 2964982..d851bf7 100644
--- a/src/net/dnsname_test.go
+++ b/src/net/dnsname_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 net
diff --git a/src/net/error_posix.go b/src/net/error_posix.go
index d709a27..50eb66f 100644
--- a/src/net/error_posix.go
+++ b/src/net/error_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
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package net
diff --git a/src/net/error_posix_test.go b/src/net/error_posix_test.go
index b411a37..ea52a45 100644
--- a/src/net/error_posix_test.go
+++ b/src/net/error_posix_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
// +build !plan9
package net
diff --git a/src/net/error_test.go b/src/net/error_test.go
index 556eb8c..c304390 100644
--- a/src/net/error_test.go
+++ b/src/net/error_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 net
diff --git a/src/net/error_unix.go b/src/net/error_unix.go
index e615330..d0b5e2c 100644
--- a/src/net/error_unix.go
+++ b/src/net/error_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 || js || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd js linux netbsd openbsd solaris
package net
diff --git a/src/net/error_unix_test.go b/src/net/error_unix_test.go
index 9ce9e12..533a45e 100644
--- a/src/net/error_unix_test.go
+++ b/src/net/error_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 !plan9 && !windows
// +build !plan9,!windows
package net
diff --git a/src/net/external_test.go b/src/net/external_test.go
index f3c69c4..b8753cc 100644
--- a/src/net/external_test.go
+++ b/src/net/external_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 net
diff --git a/src/net/fd_posix.go b/src/net/fd_posix.go
index 53abd15..2945e46 100644
--- a/src/net/fd_posix.go
+++ b/src/net/fd_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 || linux || netbsd || openbsd || solaris || windows
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
package net
diff --git a/src/net/fd_unix.go b/src/net/fd_unix.go
index 1c9bba3..a7bbdd2 100644
--- a/src/net/fd_unix.go
+++ b/src/net/fd_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 net
diff --git a/src/net/file_stub.go b/src/net/file_stub.go
index bfb8100..9f988fe 100644
--- a/src/net/file_stub.go
+++ b/src/net/file_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 js && wasm
// +build js,wasm
package net
diff --git a/src/net/file_test.go b/src/net/file_test.go
index 8c09c0d..a70ef1b 100644
--- a/src/net/file_test.go
+++ b/src/net/file_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 net
diff --git a/src/net/file_unix.go b/src/net/file_unix.go
index dba6955..4520d4b 100644
--- a/src/net/file_unix.go
+++ b/src/net/file_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 net
diff --git a/src/net/hook_unix.go b/src/net/hook_unix.go
index a28f1e0..b9153d1 100644
--- a/src/net/hook_unix.go
+++ b/src/net/hook_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 || (js && wasm) || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris
package net
diff --git a/src/net/http/cgi/plan9_test.go b/src/net/http/cgi/plan9_test.go
index cc20fe0..f998bac 100644
--- a/src/net/http/cgi/plan9_test.go
+++ b/src/net/http/cgi/plan9_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
// +build plan9
package cgi
diff --git a/src/net/http/cgi/posix_test.go b/src/net/http/cgi/posix_test.go
index 9396ce0..bc58ea9 100644
--- a/src/net/http/cgi/posix_test.go
+++ b/src/net/http/cgi/posix_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
// +build !plan9
package cgi
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 6bef310..0379848 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -1,3 +1,4 @@
+//go:build !nethttpomithttp2
// +build !nethttpomithttp2
// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.
diff --git a/src/net/http/omithttp2.go b/src/net/http/omithttp2.go
index 30c6e48..79599d0 100644
--- a/src/net/http/omithttp2.go
+++ b/src/net/http/omithttp2.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 nethttpomithttp2
// +build nethttpomithttp2
package http
diff --git a/src/net/http/roundtrip.go b/src/net/http/roundtrip.go
index 2ec736b..eef7c79 100644
--- a/src/net/http/roundtrip.go
+++ b/src/net/http/roundtrip.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 http
diff --git a/src/net/http/roundtrip_js.go b/src/net/http/roundtrip_js.go
index c6a221a..74c83a9 100644
--- a/src/net/http/roundtrip_js.go
+++ b/src/net/http/roundtrip_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 http
diff --git a/src/net/http/triv.go b/src/net/http/triv.go
index 23e65d5..4dc6240 100644
--- a/src/net/http/triv.go
+++ b/src/net/http/triv.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/net/interface_bsd.go b/src/net/interface_bsd.go
index d791cb3..7578b1a 100644
--- a/src/net/interface_bsd.go
+++ b/src/net/interface_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 darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package net
diff --git a/src/net/interface_bsd_test.go b/src/net/interface_bsd_test.go
index 947dde7..8d0d9c3 100644
--- a/src/net/interface_bsd_test.go
+++ b/src/net/interface_bsd_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 || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package net
diff --git a/src/net/interface_bsdvar.go b/src/net/interface_bsdvar.go
index a809b5f..6230e0b 100644
--- a/src/net/interface_bsdvar.go
+++ b/src/net/interface_bsdvar.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 || netbsd || openbsd
// +build dragonfly netbsd openbsd
package net
diff --git a/src/net/interface_stub.go b/src/net/interface_stub.go
index ec58665..efe67c2 100644
--- a/src/net/interface_stub.go
+++ b/src/net/interface_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 js && wasm
// +build js,wasm
package net
diff --git a/src/net/interface_test.go b/src/net/interface_test.go
index b2ef21e..754db36 100644
--- a/src/net/interface_test.go
+++ b/src/net/interface_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 net
diff --git a/src/net/interface_unix_test.go b/src/net/interface_unix_test.go
index bf41a0f..0d69fa5 100644
--- a/src/net/interface_unix_test.go
+++ b/src/net/interface_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 darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build darwin dragonfly freebsd linux netbsd openbsd
package net
diff --git a/src/net/internal/socktest/main_test.go b/src/net/internal/socktest/main_test.go
index 3b0a48a..8af85d3 100644
--- a/src/net/internal/socktest/main_test.go
+++ b/src/net/internal/socktest/main_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 && !plan9
// +build !js,!plan9
package socktest_test
diff --git a/src/net/internal/socktest/main_unix_test.go b/src/net/internal/socktest/main_unix_test.go
index 4d9d414..6aa8875 100644
--- a/src/net/internal/socktest/main_unix_test.go
+++ b/src/net/internal/socktest/main_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 !js && !plan9 && !windows
// +build !js,!plan9,!windows
package socktest_test
diff --git a/src/net/internal/socktest/switch_posix.go b/src/net/internal/socktest/switch_posix.go
index 863edef..cda74e8 100644
--- a/src/net/internal/socktest/switch_posix.go
+++ b/src/net/internal/socktest/switch_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 !plan9
// +build !plan9
package socktest
diff --git a/src/net/internal/socktest/switch_stub.go b/src/net/internal/socktest/switch_stub.go
index 28ce72c..5aa2ece 100644
--- a/src/net/internal/socktest/switch_stub.go
+++ b/src/net/internal/socktest/switch_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 socktest
diff --git a/src/net/internal/socktest/switch_unix.go b/src/net/internal/socktest/switch_unix.go
index 7dc3518..bfe9d4d 100644
--- a/src/net/internal/socktest/switch_unix.go
+++ b/src/net/internal/socktest/switch_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 || (js && wasm) || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris
package socktest
diff --git a/src/net/internal/socktest/sys_cloexec.go b/src/net/internal/socktest/sys_cloexec.go
index 421352c..c7f8331 100644
--- a/src/net/internal/socktest/sys_cloexec.go
+++ b/src/net/internal/socktest/sys_cloexec.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 || illumos || linux || netbsd || openbsd
// +build dragonfly freebsd illumos linux netbsd openbsd
package socktest
diff --git a/src/net/internal/socktest/sys_unix.go b/src/net/internal/socktest/sys_unix.go
index 0525512..e7cc459 100644
--- a/src/net/internal/socktest/sys_unix.go
+++ b/src/net/internal/socktest/sys_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 || (js && wasm) || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris
package socktest
diff --git a/src/net/ip_test.go b/src/net/ip_test.go
index a5fc5e6..1e09ae9 100644
--- a/src/net/ip_test.go
+++ b/src/net/ip_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 net
diff --git a/src/net/iprawsock_posix.go b/src/net/iprawsock_posix.go
index e653f6a..c1514f1 100644
--- a/src/net/iprawsock_posix.go
+++ b/src/net/iprawsock_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
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package net
diff --git a/src/net/iprawsock_test.go b/src/net/iprawsock_test.go
index 8e3543d..a96448e 100644
--- a/src/net/iprawsock_test.go
+++ b/src/net/iprawsock_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 net
diff --git a/src/net/ipsock_posix.go b/src/net/ipsock_posix.go
index 8763d57..8d8a896 100644
--- a/src/net/ipsock_posix.go
+++ b/src/net/ipsock_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
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package net
diff --git a/src/net/listen_test.go b/src/net/listen_test.go
index d8c7209..b1dce29 100644
--- a/src/net/listen_test.go
+++ b/src/net/listen_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 && !plan9
// +build !js,!plan9
package net
diff --git a/src/net/lookup_fake.go b/src/net/lookup_fake.go
index 3b3c39b..f4fcaed 100644
--- a/src/net/lookup_fake.go
+++ b/src/net/lookup_fake.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 net
diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go
index 32a0d37..3faaf00 100644
--- a/src/net/lookup_test.go
+++ b/src/net/lookup_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 net
diff --git a/src/net/lookup_unix.go b/src/net/lookup_unix.go
index 9055826..c09afb3 100644
--- a/src/net/lookup_unix.go
+++ b/src/net/lookup_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 net
diff --git a/src/net/main_cloexec_test.go b/src/net/main_cloexec_test.go
index 46b9ba5..742be2f 100644
--- a/src/net/main_cloexec_test.go
+++ b/src/net/main_cloexec_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 || illumos || linux || netbsd || openbsd
// +build dragonfly freebsd illumos linux netbsd openbsd
package net
diff --git a/src/net/main_conf_test.go b/src/net/main_conf_test.go
index a92dff5..645b267 100644
--- a/src/net/main_conf_test.go
+++ b/src/net/main_conf_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 && !plan9 && !windows
// +build !js,!plan9,!windows
package net
diff --git a/src/net/main_noconf_test.go b/src/net/main_noconf_test.go
index bac84aa..bcea630c 100644
--- a/src/net/main_noconf_test.go
+++ b/src/net/main_noconf_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 && wasm) || plan9 || windows
// +build js,wasm plan9 windows
package net
diff --git a/src/net/main_posix_test.go b/src/net/main_posix_test.go
index f2484f3..c9ab25a 100644
--- a/src/net/main_posix_test.go
+++ b/src/net/main_posix_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 && !plan9
// +build !js,!plan9
package net
diff --git a/src/net/main_test.go b/src/net/main_test.go
index 2d5be2e..dc17d3f 100644
--- a/src/net/main_test.go
+++ b/src/net/main_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 net
diff --git a/src/net/main_unix_test.go b/src/net/main_unix_test.go
index 8b98976..c8cff2d 100644
--- a/src/net/main_unix_test.go
+++ b/src/net/main_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 net
diff --git a/src/net/mockserver_test.go b/src/net/mockserver_test.go
index 867e31e..b50a1e5 100644
--- a/src/net/mockserver_test.go
+++ b/src/net/mockserver_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 net
diff --git a/src/net/net_fake.go b/src/net/net_fake.go
index 0c48dd5..49dc57c 100644
--- a/src/net/net_fake.go
+++ b/src/net/net_fake.go
@@ -4,6 +4,7 @@
// Fake networking for js/wasm. It is intended to allow tests of other package to pass.
+//go:build js && wasm
// +build js,wasm
package net
diff --git a/src/net/net_test.go b/src/net/net_test.go
index 409e140..6d6299e 100644
--- a/src/net/net_test.go
+++ b/src/net/net_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 net
diff --git a/src/net/netgo_unix_test.go b/src/net/netgo_unix_test.go
index c672d3e..0dfd6c2 100644
--- a/src/net/netgo_unix_test.go
+++ b/src/net/netgo_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 (!cgo || netgo) && (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris)
// +build !cgo netgo
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
diff --git a/src/net/nss.go b/src/net/nss.go
index 96b9cdd..85177ca 100644
--- a/src/net/nss.go
+++ b/src/net/nss.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 net
diff --git a/src/net/nss_test.go b/src/net/nss_test.go
index 371deb5..4b73886 100644
--- a/src/net/nss_test.go
+++ b/src/net/nss_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 || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package net
diff --git a/src/net/packetconn_test.go b/src/net/packetconn_test.go
index a377d33..aeb9845 100644
--- a/src/net/packetconn_test.go
+++ b/src/net/packetconn_test.go
@@ -5,6 +5,7 @@
// This file implements API tests across platforms and will never have a build
// tag.
+//go:build !js
// +build !js
package net
diff --git a/src/net/port_unix.go b/src/net/port_unix.go
index 4fdd9a3..a9a96a2 100644
--- a/src/net/port_unix.go
+++ b/src/net/port_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 || (js && wasm) || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris
// Read system port mappings from /etc/services
diff --git a/src/net/protoconn_test.go b/src/net/protoconn_test.go
index 6f83f52..fc9b386 100644
--- a/src/net/protoconn_test.go
+++ b/src/net/protoconn_test.go
@@ -5,6 +5,7 @@
// This file implements API tests across platforms and will never have a build
// tag.
+//go:build !js
// +build !js
package net
diff --git a/src/net/rawconn_stub_test.go b/src/net/rawconn_stub_test.go
index cec977f..975aa8d 100644
--- a/src/net/rawconn_stub_test.go
+++ b/src/net/rawconn_stub_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 && wasm) || plan9
// +build js,wasm plan9
package net
diff --git a/src/net/rawconn_test.go b/src/net/rawconn_test.go
index a08ff89..3ef7af3 100644
--- a/src/net/rawconn_test.go
+++ b/src/net/rawconn_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 net
diff --git a/src/net/rawconn_unix_test.go b/src/net/rawconn_unix_test.go
index 0194ba6..75bbab8 100644
--- a/src/net/rawconn_unix_test.go
+++ b/src/net/rawconn_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 net
diff --git a/src/net/sendfile_stub.go b/src/net/sendfile_stub.go
index 53bc53a..5753bc0 100644
--- a/src/net/sendfile_stub.go
+++ b/src/net/sendfile_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 aix || darwin || (js && wasm) || netbsd || openbsd
// +build aix darwin js,wasm netbsd openbsd
package net
diff --git a/src/net/sendfile_test.go b/src/net/sendfile_test.go
index d6057fd..db72daa 100644
--- a/src/net/sendfile_test.go
+++ b/src/net/sendfile_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 net
diff --git a/src/net/sendfile_unix_alt.go b/src/net/sendfile_unix_alt.go
index 8cededc..54667d6 100644
--- a/src/net/sendfile_unix_alt.go
+++ b/src/net/sendfile_unix_alt.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 || solaris
// +build dragonfly freebsd solaris
package net
diff --git a/src/net/server_test.go b/src/net/server_test.go
index 4ac5443..8d4db72 100644
--- a/src/net/server_test.go
+++ b/src/net/server_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 net
diff --git a/src/net/sock_bsd.go b/src/net/sock_bsd.go
index 73fb6be..4c883ad 100644
--- a/src/net/sock_bsd.go
+++ b/src/net/sock_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 darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package net
diff --git a/src/net/sock_cloexec.go b/src/net/sock_cloexec.go
index 5f345f0..efc91fd 100644
--- a/src/net/sock_cloexec.go
+++ b/src/net/sock_cloexec.go
@@ -5,6 +5,7 @@
// This file implements sysSocket and accept for platforms that
// provide a fast path for setting SetNonblock and CloseOnExec.
+//go:build dragonfly || freebsd || illumos || linux || netbsd || openbsd
// +build dragonfly freebsd illumos linux netbsd openbsd
package net
diff --git a/src/net/sock_posix.go b/src/net/sock_posix.go
index 80b4169..9b1e788 100644
--- a/src/net/sock_posix.go
+++ b/src/net/sock_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 || linux || netbsd || openbsd || solaris || windows
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
package net
diff --git a/src/net/sock_stub.go b/src/net/sock_stub.go
index c9f86af..d804bfa 100644
--- a/src/net/sock_stub.go
+++ b/src/net/sock_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 aix || (js && wasm) || solaris
// +build aix js,wasm solaris
package net
diff --git a/src/net/sockaddr_posix.go b/src/net/sockaddr_posix.go
index a3710dd..9d77cb5 100644
--- a/src/net/sockaddr_posix.go
+++ b/src/net/sockaddr_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
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package net
diff --git a/src/net/sockopt_bsd.go b/src/net/sockopt_bsd.go
index 8fd1e88..216e5d5 100644
--- a/src/net/sockopt_bsd.go
+++ b/src/net/sockopt_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 darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package net
diff --git a/src/net/sockopt_posix.go b/src/net/sockopt_posix.go
index de72556..50b9bfa 100644
--- a/src/net/sockopt_posix.go
+++ b/src/net/sockopt_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 || linux || netbsd || openbsd || solaris || windows
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
package net
diff --git a/src/net/sockopt_stub.go b/src/net/sockopt_stub.go
index 52624a3..99b5277 100644
--- a/src/net/sockopt_stub.go
+++ b/src/net/sockopt_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 js && wasm
// +build js,wasm
package net
diff --git a/src/net/sockoptip_bsdvar.go b/src/net/sockoptip_bsdvar.go
index 20a6dc9..56022fd 100644
--- a/src/net/sockoptip_bsdvar.go
+++ b/src/net/sockoptip_bsdvar.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 || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd netbsd openbsd solaris
package net
diff --git a/src/net/sockoptip_posix.go b/src/net/sockoptip_posix.go
index b14963f..a2143ae 100644
--- a/src/net/sockoptip_posix.go
+++ b/src/net/sockoptip_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 || linux || netbsd || openbsd || solaris || windows
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
package net
diff --git a/src/net/sockoptip_stub.go b/src/net/sockoptip_stub.go
index 57cd289..4175922 100644
--- a/src/net/sockoptip_stub.go
+++ b/src/net/sockoptip_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 js && wasm
// +build js,wasm
package net
diff --git a/src/net/splice_stub.go b/src/net/splice_stub.go
index 9106cb2..ce2e904 100644
--- a/src/net/splice_stub.go
+++ b/src/net/splice_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 !linux
// +build !linux
package net
diff --git a/src/net/splice_test.go b/src/net/splice_test.go
index 8a0cda6..be13cc9 100644
--- a/src/net/splice_test.go
+++ b/src/net/splice_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
// +build linux
package net
diff --git a/src/net/sys_cloexec.go b/src/net/sys_cloexec.go
index 967b8be..4d71120 100644
--- a/src/net/sys_cloexec.go
+++ b/src/net/sys_cloexec.go
@@ -5,6 +5,7 @@
// This file implements sysSocket and accept for platforms that do not
// provide a fast path for setting SetNonblock and CloseOnExec.
+//go:build aix || darwin || (solaris && !illumos)
// +build aix darwin solaris,!illumos
package net
diff --git a/src/net/tcpsock_posix.go b/src/net/tcpsock_posix.go
index 257c119..7c4523c 100644
--- a/src/net/tcpsock_posix.go
+++ b/src/net/tcpsock_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
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package net
diff --git a/src/net/tcpsock_test.go b/src/net/tcpsock_test.go
index d6172bc..9c9f1ea 100644
--- a/src/net/tcpsock_test.go
+++ b/src/net/tcpsock_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 net
diff --git a/src/net/tcpsock_unix_test.go b/src/net/tcpsock_unix_test.go
index 2bd591b..41bd229 100644
--- a/src/net/tcpsock_unix_test.go
+++ b/src/net/tcpsock_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 !js && !plan9 && !windows
// +build !js,!plan9,!windows
package net
diff --git a/src/net/tcpsockopt_posix.go b/src/net/tcpsockopt_posix.go
index 5e00ba1..d08832a 100644
--- a/src/net/tcpsockopt_posix.go
+++ b/src/net/tcpsockopt_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 || linux || netbsd || openbsd || solaris || windows
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
package net
diff --git a/src/net/tcpsockopt_stub.go b/src/net/tcpsockopt_stub.go
index d043da1..028d5fd 100644
--- a/src/net/tcpsockopt_stub.go
+++ b/src/net/tcpsockopt_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 js && wasm
// +build js,wasm
package net
diff --git a/src/net/tcpsockopt_unix.go b/src/net/tcpsockopt_unix.go
index fb0ecb8..a945889 100644
--- a/src/net/tcpsockopt_unix.go
+++ b/src/net/tcpsockopt_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 || freebsd || linux || netbsd
// +build aix freebsd linux netbsd
package net
diff --git a/src/net/timeout_test.go b/src/net/timeout_test.go
index 205aaa4..e1cf146 100644
--- a/src/net/timeout_test.go
+++ b/src/net/timeout_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 net
diff --git a/src/net/udpsock_posix.go b/src/net/udpsock_posix.go
index bbfa4ed..58c69f1 100644
--- a/src/net/udpsock_posix.go
+++ b/src/net/udpsock_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
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package net
diff --git a/src/net/udpsock_test.go b/src/net/udpsock_test.go
index 327eba6..7a1ed4e 100644
--- a/src/net/udpsock_test.go
+++ b/src/net/udpsock_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 net
diff --git a/src/net/unixsock_posix.go b/src/net/unixsock_posix.go
index 275c7c9..1d1f274 100644
--- a/src/net/unixsock_posix.go
+++ b/src/net/unixsock_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
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows
package net
diff --git a/src/net/unixsock_test.go b/src/net/unixsock_test.go
index 0b13bf6..71092e8 100644
--- a/src/net/unixsock_test.go
+++ b/src/net/unixsock_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 && !plan9 && !windows
// +build !js,!plan9,!windows
package net
diff --git a/src/net/unixsock_windows_test.go b/src/net/unixsock_windows_test.go
index 5dccc14..29244f6 100644
--- a/src/net/unixsock_windows_test.go
+++ b/src/net/unixsock_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
// +build windows
package net
diff --git a/src/net/write_unix_test.go b/src/net/write_unix_test.go
index 6d8cb6a..f79f2d0 100644
--- a/src/net/write_unix_test.go
+++ b/src/net/write_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 darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package net
diff --git a/src/net/writev_test.go b/src/net/writev_test.go
index d603b7f..bf40ca2 100644
--- a/src/net/writev_test.go
+++ b/src/net/writev_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 net
diff --git a/src/net/writev_unix.go b/src/net/writev_unix.go
index 8b20f42..a0fedc2 100644
--- a/src/net/writev_unix.go
+++ b/src/net/writev_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 darwin || dragonfly || freebsd || illumos || linux || netbsd || openbsd
// +build darwin dragonfly freebsd illumos linux netbsd openbsd
package net