Start migrating rules_go workspace to bzlmod (#4526)

<!-- Thanks for sending a PR! Before submitting:

1. If this is your first PR, please read CONTRIBUTING.md and sign the
CLA
   first. We cannot review code without a signed CLA.
2. Please file an issue *first*. All features and most bug fixes should
have
an associated issue with a design discussed and decided upon. Small bug
   fixes and documentation improvements don't need issues.
3. New features and bug fixes must have tests. Documentation may need to
be updated. If you're unsure what to update, send the PR, and we'll
discuss
   in review.
4. Note that PRs updating dependencies and new Go versions are not
accepted.
   Please file an issue instead.
-->

**What type of PR is this?**

> Uncomment one line below and remove others.
>
> Bug fix
> Feature
> Documentation
> Other

**What does this PR do? Why is it needed?**

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**
diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml
index 0eda9af..8224926 100644
--- a/.bazelci/presubmit.yml
+++ b/.bazelci/presubmit.yml
@@ -14,7 +14,7 @@
 tasks:
   debian11_bazel6:
     platform: debian11
-    bazel: 6.5.0 # test minimum supported version of bazel
+    bazel: 7.1.0 # test minimum supported version of bazel that works with our bzlmod setup
     build_targets:
       - "//..."
       - "-//tests/core/go_binary:goos_pure_bin"
diff --git a/.bazelrc b/.bazelrc
index 0714809..5c76be5 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,9 +1,6 @@
 startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1
 
 common --enable_platform_specific_config
-# TODO: Temporarily disable while rules_go migrates to Bzlmod for its dev build.
-# https://github.com/bazelbuild/bazel/issues/18958
-common --noexperimental_enable_bzlmod
 # Improve caching, but allow integration tests to find `bazel` in PATH.
 # Doesn't work on Windows as protoc requires DLLs outside the default PATH.
 common:macos --incompatible_strict_action_env
diff --git a/MODULE.bazel b/MODULE.bazel
index 8e57687..1b0a013 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -6,11 +6,11 @@
 
 # The custom repo_name is used to prevent our bazel_features polyfill for WORKSPACE builds from
 # conflicting with the real bazel_features repo.
-bazel_dep(name = "bazel_features", version = "1.9.1", repo_name = "io_bazel_rules_go_bazel_features")
+bazel_dep(name = "bazel_features", version = "1.28.0", repo_name = "io_bazel_rules_go_bazel_features")
 bazel_dep(name = "bazel_skylib", version = "1.2.0")
 bazel_dep(name = "platforms", version = "1.0.0")
 bazel_dep(name = "rules_proto", version = "7.0.2")
-bazel_dep(name = "protobuf", version = "29.0-rc2.bcr.1", repo_name = "com_google_protobuf")
+bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
 bazel_dep(name = "rules_shell", version = "0.3.0")
 bazel_dep(name = "rules_cc", version = "0.1.5")
 
@@ -50,4 +50,21 @@
     "org_golang_x_tools",
     # Exported by gazelle specifically for rules_go.
     "bazel_gazelle_go_repository_config",
+    "org_golang_google_genproto_googleapis_bytestream",
+    "org_golang_google_genproto_googleapis_rpc",
+    "org_golang_x_crypto",
 )
+
+### Dev dependencies
+
+bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True)
+
+dev_go_sdk = use_extension("//go:extensions.bzl", "go_sdk", dev_dependency = True)
+
+dev_go_sdk.download(
+    name = "rules_go_internal_compatibility_sdk",
+    version = "1.22.12",
+)
+
+# Used to transition binaries in rules_go's test suite to different configurations.
+bazel_dep(name = "with_cfg.bzl", version = "0.14.1", dev_dependency = True)
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
index f624902..2e43249 100644
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -18,6 +18,7 @@
     "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d",
     "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a",
     "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58",
+    "https://bcr.bazel.build/modules/bazel_features/1.24.0/MODULE.bazel": "4796b4c25b47053e9bbffa792b3792d07e228ff66cd0405faef56a978708acd4",
     "https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65",
     "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d",
     "https://bcr.bazel.build/modules/bazel_features/1.28.0/source.json": "16a3fc5b4483cb307643791f5a4b7365fa98d2e70da7c378cdbde55f0c0b32cf",
@@ -59,8 +60,8 @@
     "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7",
     "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c",
     "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d",
-    "https://bcr.bazel.build/modules/protobuf/29.0-rc2.bcr.1/MODULE.bazel": "52f4126f63a2f0bbf36b99c2a87648f08467a4eaf92ba726bc7d6a500bbf770c",
-    "https://bcr.bazel.build/modules/protobuf/29.0-rc2.bcr.1/source.json": "cfbee3381201f20e35c304041b4abb3b793e66c9b1829b5478d033ad4a5e3aef",
+    "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e",
+    "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981",
     "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0",
     "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858",
     "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e",
@@ -72,8 +73,9 @@
     "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647",
     "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002",
     "https://bcr.bazel.build/modules/rules_cc/0.0.11/MODULE.bazel": "9f249c5624a4788067b96b8b896be10c7e8b4375dc46f6d8e1e51100113e0992",
-    "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191",
     "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc",
+    "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87",
+    "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a",
     "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c",
     "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f",
     "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e",
@@ -88,15 +90,18 @@
     "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31",
     "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a",
     "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6",
-    "https://bcr.bazel.build/modules/rules_java/7.12.2/source.json": "b0890f9cda8ff1b8e691a3ac6037b5c14b7fd4134765a3946b89f31ea02e5884",
     "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab",
     "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe",
     "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1",
+    "https://bcr.bazel.build/modules/rules_java/8.6.0/MODULE.bazel": "9c064c434606d75a086f15ade5edb514308cccd1544c2b2a89bbac4310e41c71",
+    "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2",
+    "https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960",
     "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7",
     "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909",
     "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036",
     "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0",
-    "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197",
+    "https://bcr.bazel.build/modules/rules_jvm_external/6.6/MODULE.bazel": "153042249c7060536dc95b6bb9f9bb8063b8a0b0cb7acdb381bddbc2374aed55",
+    "https://bcr.bazel.build/modules/rules_jvm_external/6.6/source.json": "b1d7ffc3877e5a76e6e48e6bce459cbb1712c90eba14861b112bd299587a534d",
     "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3",
     "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5",
     "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0",
@@ -125,7 +130,11 @@
     "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8",
     "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c",
     "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c",
+    "https://bcr.bazel.build/modules/stardoc/0.8.0/MODULE.bazel": "bbad4298d7ba185684f5fcd71b049c95b0575d1248891fd80b8d7077d647c9d8",
+    "https://bcr.bazel.build/modules/stardoc/0.8.0/source.json": "7321db37080ee8a445dc60e8516a98ab3a27884d1457b892485d73759ccb7f4d",
     "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43",
+    "https://bcr.bazel.build/modules/with_cfg.bzl/0.14.1/MODULE.bazel": "aa0ef3f6c67dd35db7ac38c76785dc02f48b53f34e16b20487e70f51b5324d0a",
+    "https://bcr.bazel.build/modules/with_cfg.bzl/0.14.1/source.json": "4666d3035f69063ecd136f3f0c68e424f1b1dd97ffc9cceb679522c0be38761b",
     "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0",
     "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27",
     "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79",
@@ -134,127 +143,23 @@
   },
   "selectedYankedVersions": {},
   "moduleExtensions": {
-    "@@pybind11_bazel~//:python_configure.bzl%extension": {
+    "@@rules_java~//java:rules_java_deps.bzl%compatibility_proxy": {
       "general": {
-        "bzlTransitiveDigest": "whINYge95GgPtysKDbNHQ0ZlWYdtKybHs5y2tLF+x7Q=",
-        "usagesDigest": "gNvOHVcAlwgDsNXD0amkv2CC96mnaCThPQoE44y8K+w=",
-        "recordedFileInputs": {
-          "@@pybind11_bazel~//MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e"
-        },
-        "recordedDirentsInputs": {},
-        "envVariables": {},
-        "generatedRepoSpecs": {
-          "local_config_python": {
-            "bzlFile": "@@pybind11_bazel~//:python_configure.bzl",
-            "ruleClassName": "python_configure",
-            "attributes": {}
-          },
-          "pybind11": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_archive",
-            "attributes": {
-              "build_file": "@@pybind11_bazel~//:pybind11.BUILD",
-              "strip_prefix": "pybind11-2.11.1",
-              "urls": [
-                "https://github.com/pybind/pybind11/archive/v2.11.1.zip"
-              ]
-            }
-          }
-        },
-        "recordedRepoMappingEntries": [
-          [
-            "pybind11_bazel~",
-            "bazel_tools",
-            "bazel_tools"
-          ]
-        ]
-      }
-    },
-    "@@rules_fuzzing~//fuzzing/private:extensions.bzl%non_module_dependencies": {
-      "general": {
-        "bzlTransitiveDigest": "hVgJRQ3Er45/UUAgNn1Yp2Khcp/Y8WyafA2kXIYmQ5M=",
-        "usagesDigest": "YnIrdgwnf3iCLfChsltBdZ7yOJh706lpa2vww/i2pDI=",
+        "bzlTransitiveDigest": "wz/gaA3xHNx01lt9KMTpLRTOGQHRWnTsAPhRfjdk21k=",
+        "usagesDigest": "I6+CGVbSrNp2QwSmF31WrXKCF4JkXIiGHgmLdJ7jzeQ=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
         "envVariables": {},
         "generatedRepoSpecs": {
-          "platforms": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_archive",
-            "attributes": {
-              "urls": [
-                "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
-                "https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"
-              ],
-              "sha256": "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74"
-            }
-          },
-          "rules_python": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_archive",
-            "attributes": {
-              "sha256": "d70cd72a7a4880f0000a6346253414825c19cdd40a28289bdf67b8e6480edff8",
-              "strip_prefix": "rules_python-0.28.0",
-              "url": "https://github.com/bazelbuild/rules_python/releases/download/0.28.0/rules_python-0.28.0.tar.gz"
-            }
-          },
-          "bazel_skylib": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_archive",
-            "attributes": {
-              "sha256": "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
-              "urls": [
-                "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
-                "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"
-              ]
-            }
-          },
-          "com_google_absl": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_archive",
-            "attributes": {
-              "urls": [
-                "https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.1.zip"
-              ],
-              "strip_prefix": "abseil-cpp-20240116.1",
-              "integrity": "sha256-7capMWOvWyoYbUaHF/b+I2U6XLMaHmky8KugWvfXYuk="
-            }
-          },
-          "rules_fuzzing_oss_fuzz": {
-            "bzlFile": "@@rules_fuzzing~//fuzzing/private/oss_fuzz:repository.bzl",
-            "ruleClassName": "oss_fuzz_repository",
+          "compatibility_proxy": {
+            "bzlFile": "@@rules_java~//java:rules_java_deps.bzl",
+            "ruleClassName": "_compatibility_proxy_repo_rule",
             "attributes": {}
-          },
-          "honggfuzz": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_archive",
-            "attributes": {
-              "build_file": "@@rules_fuzzing~//:honggfuzz.BUILD",
-              "sha256": "6b18ba13bc1f36b7b950c72d80f19ea67fbadc0ac0bb297ec89ad91f2eaa423e",
-              "url": "https://github.com/google/honggfuzz/archive/2.5.zip",
-              "strip_prefix": "honggfuzz-2.5"
-            }
-          },
-          "rules_fuzzing_jazzer": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_jar",
-            "attributes": {
-              "sha256": "ee6feb569d88962d59cb59e8a31eb9d007c82683f3ebc64955fd5b96f277eec2",
-              "url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer/0.20.1/jazzer-0.20.1.jar"
-            }
-          },
-          "rules_fuzzing_jazzer_api": {
-            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
-            "ruleClassName": "http_jar",
-            "attributes": {
-              "sha256": "f5a60242bc408f7fa20fccf10d6c5c5ea1fcb3c6f44642fec5af88373ae7aa1b",
-              "url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer-api/0.20.1/jazzer-api-0.20.1.jar"
-            }
           }
         },
         "recordedRepoMappingEntries": [
           [
-            "rules_fuzzing~",
+            "rules_java~",
             "bazel_tools",
             "bazel_tools"
           ]
@@ -263,7 +168,7 @@
     },
     "@@rules_kotlin~//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": {
       "general": {
-        "bzlTransitiveDigest": "fus14IFJ/1LGWWGKPH/U18VnJCoMjfDt1ckahqCnM0A=",
+        "bzlTransitiveDigest": "eecmTsmdIQveoA97hPtH3/Ej/kugbdCI24bhXIXaly8=",
         "usagesDigest": "aJF6fLy82rR95Ff5CZPAqxNoFgOMLMN5ImfBS0nhnkg=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
@@ -1131,8 +1036,8 @@
     },
     "@@rules_python~//python/extensions:python.bzl%python": {
       "general": {
-        "bzlTransitiveDigest": "8vDKUdCc6qEk2/YsFiPsFO1Jqgl+XPFRklapOxMAbE8=",
-        "usagesDigest": "VeZ9AAKeQZSVw3zpP+cQF00n7ph8TEMpVgkm6b6+I9s=",
+        "bzlTransitiveDigest": "NKPsijGE1IrFTzT0W0yfAohwWNIZt6eB23MGn2bM1OU=",
+        "usagesDigest": "3AdTkHM1EnRWIHoPAZGwbV4mega2sr3+ss2DZ3Y5ppg=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
         "envVariables": {
@@ -1964,7 +1869,7 @@
     },
     "@@rules_python~//python/private/bzlmod:internal_deps.bzl%internal_deps": {
       "general": {
-        "bzlTransitiveDigest": "7yogJIhmw7i9Wq/n9sQB8N0F84220dJbw64SjOwrmQk=",
+        "bzlTransitiveDigest": "5gQYH7IOUlRNgdc7jspILfMHm3iqMl3ZPlJvONOn1/o=",
         "usagesDigest": "r7vtlnQfWxEwrL+QFXux06yzeWEkq/hrcwAssoCoSLY=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
diff --git a/WORKSPACE b/WORKSPACE
index 1ef9e50..ff9e791 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,7 +1,7 @@
 workspace(name = "io_bazel_rules_go")
 
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_nogo", "go_register_toolchains", "go_rules_dependencies")
+load("@io_bazel_rules_go//go:deps.bzl", "go_register_nogo", "go_register_toolchains", "go_rules_dependencies")
 
 # Required by toolchains_protoc.
 http_archive(
@@ -53,15 +53,6 @@
 
 go_register_toolchains(version = "1.24.0")
 
-# Required since nogo depends on golang.org/x/tools, which needs to be at
-# least version 0.30.0 to be compatible with Go 1.24, but references
-# types.Info.FileVersions, which was only added to Go 1.22.
-
-go_download_sdk(
-    name = "rules_go_internal_compatibility_sdk",
-    version = "1.22.12",
-)
-
 go_register_nogo(
     nogo = "@//internal:nogo",
 )
@@ -104,32 +95,6 @@
     version = "v25.3",
 )
 
-# An up-to-date version is required by com_google_protobuf below.
-http_archive(
-    name = "rules_python",
-    sha256 = "ca77768989a7f311186a29747e3e95c936a41dffac779aff6b443db22290d913",
-    strip_prefix = "rules_python-0.36.0",
-    url = "https://github.com/bazelbuild/rules_python/releases/download/0.36.0/rules_python-0.36.0.tar.gz",
-)
-
-load("@rules_python//python:repositories.bzl", "py_repositories")
-
-py_repositories()
-
-http_archive(
-    name = "com_google_protobuf",
-    integrity = "sha256-zl0At4RQoMpAC/NgrADA1ZnMIl8EnZhqJ+mk45bFqEo=",
-    strip_prefix = "protobuf-29.0-rc2",
-    urls = [
-        "https://github.com/protocolbuffers/protobuf/archive/v29.0-rc2.tar.gz",
-        "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v29.0-rc2.tar.gz",
-    ],
-)
-
-load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
-
-protobuf_deps()
-
 # Used by //tests:buildifier_test.
 http_archive(
     name = "com_github_bazelbuild_buildtools",
@@ -219,40 +184,12 @@
 )
 
 go_repository(
-    name = "org_golang_x_mod",
-    importpath = "golang.org/x/mod",
-    sum = "h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=",
-    version = "v0.22.0",
-)
-
-go_repository(
-    name = "org_golang_x_net",
-    importpath = "golang.org/x/net",
-    sum = "h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=",
-    version = "v0.31.0",
-)
-
-go_repository(
-    name = "org_golang_x_sync",
-    importpath = "golang.org/x/sync",
-    sum = "h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=",
-    version = "v0.9.0",
-)
-
-go_repository(
     name = "org_golang_x_oauth2",
     importpath = "golang.org/x/oauth2",
     sum = "h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw=",
     version = "v0.6.0",
 )
 
-go_repository(
-    name = "org_golang_x_tools",
-    importpath = "golang.org/x/tools",
-    sum = "h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=",
-    version = "v0.27.0",
-)
-
 http_archive(
     name = "googleapis",
     sha256 = "9d1a930e767c93c825398b8f8692eca3fe353b9aaadedfbcf1fca2282c85df88",
@@ -262,16 +199,6 @@
     ],
 )
 
-go_repository(
-    name = "org_golang_google_genproto",
-    build_extra_args = ["-exclude=vendor"],
-    build_file_generation = "on",
-    build_file_proto_mode = "disable_global",
-    importpath = "google.golang.org/genproto",
-    sum = "h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y=",
-    version = "v0.0.0-20221024183307-1bc688fe9f3e",
-)
-
 load("@io_bazel_rules_go//tests/legacy/test_chdir:remote.bzl", "test_chdir_remote")
 
 test_chdir_remote()
@@ -285,22 +212,6 @@
     path = "tests/core/runfiles/runfiles_remote_test",
 )
 
-# For API doc generation
-# This is a dev dependency, users should not need to install it
-# so we declare it in the WORKSPACE
-http_archive(
-    name = "io_bazel_stardoc",
-    sha256 = "3fd8fec4ddec3c670bd810904e2e33170bedfe12f90adf943508184be458c8bb",
-    urls = [
-        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
-        "https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
-    ],
-)
-
-load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")
-
-stardoc_repositories()
-
 load(
     "@build_bazel_apple_support//lib:repositories.bzl",
     "apple_support_dependencies",
@@ -308,19 +219,6 @@
 
 apple_support_dependencies()
 
-http_archive(
-    name = "rules_shell",
-    sha256 = "d8cd4a3a91fc1dc68d4c7d6b655f09def109f7186437e3f50a9b60ab436a0c53",
-    strip_prefix = "rules_shell-0.3.0",
-    url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.3.0/rules_shell-v0.3.0.tar.gz",
-)
-
-load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
-
-rules_shell_dependencies()
-
-rules_shell_toolchains()
-
 load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")
 
 switched_rules_by_language(
@@ -346,11 +244,3 @@
     },
     version = "0.11.0-dev.3886+0c1bfe271",
 )
-
-# Used to transition binaries in rules_go's test suite to different configurations.
-http_archive(
-    name = "with_cfg.bzl",
-    sha256 = "4da2d80d55c7013e52539b0e100f8f8465142cd05757aaecb3ddca962d735c05",
-    strip_prefix = "with_cfg.bzl-0.11.1",
-    url = "https://github.com/fmeum/with_cfg.bzl/releases/download/v0.11.1/with_cfg.bzl-v0.11.1.tar.gz",
-)
diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel
index caf61b5..d4742ad 100644
--- a/docs/BUILD.bazel
+++ b/docs/BUILD.bazel
@@ -4,13 +4,11 @@
 stardoc_with_diff_test(
     bzl_library_target = "//docs/go/extras:extras",
     out_label = "//docs/go/extras:extras.md",
-    rule_template = "rule_body.vm",
 )
 
 stardoc_with_diff_test(
     bzl_library_target = "//docs/go/core:rules",
     out_label = "//docs/go/core:rules.md",
-    rule_template = "rule_body.vm",
 )
 
 # Update MD in local source tree
diff --git a/docs/doc_helpers.bzl b/docs/doc_helpers.bzl
index 7e72672..058827a 100644
--- a/docs/doc_helpers.bzl
+++ b/docs/doc_helpers.bzl
@@ -14,13 +14,12 @@
 
 load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
 load("@bazel_skylib//rules:write_file.bzl", "write_file")
-load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
+load("@stardoc//stardoc:stardoc.bzl", "stardoc")
 load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
 
 def stardoc_with_diff_test(
         bzl_library_target,
-        out_label,
-        rule_template = "@io_bazel_stardoc//stardoc:templates/markdown_tables/rule.vm"):
+        out_label):
     """Creates a stardoc target coupled with a diff_test for a given bzl_library.
 
     This is helpful for minimizing boilerplate when lots of stardoc targets are to be generated.
@@ -28,7 +27,6 @@
     Args:
         bzl_library_target: the label of the bzl_library target to generate documentation for
         out_label: the label of the output MD file
-        rule_template: the label or path to the Velocity rule template to use with stardoc
     """
 
     out_file = out_label.replace("//", "").replace(":", "/")
@@ -38,7 +36,6 @@
         name = out_file.replace("/", "_").replace(".md", "-docgen"),
         out = out_file.replace(".md", "-docgen.md"),
         input = bzl_library_target + ".bzl",
-        rule_template = rule_template,
         deps = [bzl_library_target],
     )
 
@@ -77,7 +74,7 @@
     content = ["#!/usr/bin/env bash", "cd ${BUILD_WORKSPACE_DIRECTORY}"]
     data = []
     for r in native.existing_rules().values():
-        if r["kind"] == "stardoc":
+        if r["kind"] == "stardoc_markdown_renderer":
             doc_gen = r["out"]
             if doc_gen.startswith(":"):
                 doc_gen = doc_gen[1:]
diff --git a/docs/go/core/rules.md b/docs/go/core/rules.md
index e9d912c..2c9633e 100644
--- a/docs/go/core/rules.md
+++ b/docs/go/core/rules.md
@@ -1,6 +1,5 @@
 <!-- Generated with Stardoc: http://skydoc.bazel.build -->
 
-
   ["Make variable"]: https://docs.bazel.build/versions/master/be/make-variables.html
   [Bourne shell tokenization]: https://docs.bazel.build/versions/master/be/common-definitions.html#sh-tokenization
   [Gazelle]: https://github.com/bazelbuild/bazel-gazelle
@@ -113,186 +112,175 @@
 Rules
 -----
 
-
-
-
-
-
-<a id="#go_binary"></a>
+<a id="go_binary"></a>
 
 ## go_binary
 
 <pre>
-go_binary(<a href="#go_binary-name">name</a>, <a href="#go_binary-basename">basename</a>, <a href="#go_binary-cdeps">cdeps</a>, <a href="#go_binary-cgo">cgo</a>, <a href="#go_binary-clinkopts">clinkopts</a>, <a href="#go_binary-copts">copts</a>, <a href="#go_binary-cppopts">cppopts</a>, <a href="#go_binary-cxxopts">cxxopts</a>, <a href="#go_binary-data">data</a>, <a href="#go_binary-deps">deps</a>, <a href="#go_binary-embed">embed</a>,
-          <a href="#go_binary-embedsrcs">embedsrcs</a>, <a href="#go_binary-env">env</a>, <a href="#go_binary-gc_goopts">gc_goopts</a>, <a href="#go_binary-gc_linkopts">gc_linkopts</a>, <a href="#go_binary-goarch">goarch</a>, <a href="#go_binary-goos">goos</a>, <a href="#go_binary-gotags">gotags</a>, <a href="#go_binary-importpath">importpath</a>, <a href="#go_binary-linkmode">linkmode</a>, <a href="#go_binary-msan">msan</a>,
-          <a href="#go_binary-out">out</a>, <a href="#go_binary-pgoprofile">pgoprofile</a>, <a href="#go_binary-pure">pure</a>, <a href="#go_binary-race">race</a>, <a href="#go_binary-srcs">srcs</a>, <a href="#go_binary-static">static</a>, <a href="#go_binary-x_defs">x_defs</a>)
+load("@rules_go//docs/go/core:rules.bzl", "go_binary")
+
+go_binary(<a href="#go_binary-name">name</a>, <a href="#go_binary-deps">deps</a>, <a href="#go_binary-srcs">srcs</a>, <a href="#go_binary-data">data</a>, <a href="#go_binary-out">out</a>, <a href="#go_binary-basename">basename</a>, <a href="#go_binary-cdeps">cdeps</a>, <a href="#go_binary-cgo">cgo</a>, <a href="#go_binary-clinkopts">clinkopts</a>, <a href="#go_binary-copts">copts</a>, <a href="#go_binary-cppopts">cppopts</a>, <a href="#go_binary-cxxopts">cxxopts</a>,
+          <a href="#go_binary-embed">embed</a>, <a href="#go_binary-embedsrcs">embedsrcs</a>, <a href="#go_binary-env">env</a>, <a href="#go_binary-gc_goopts">gc_goopts</a>, <a href="#go_binary-gc_linkopts">gc_linkopts</a>, <a href="#go_binary-goarch">goarch</a>, <a href="#go_binary-goos">goos</a>, <a href="#go_binary-gotags">gotags</a>, <a href="#go_binary-importpath">importpath</a>, <a href="#go_binary-linkmode">linkmode</a>,
+          <a href="#go_binary-msan">msan</a>, <a href="#go_binary-pgoprofile">pgoprofile</a>, <a href="#go_binary-pure">pure</a>, <a href="#go_binary-race">race</a>, <a href="#go_binary-static">static</a>, <a href="#go_binary-x_defs">x_defs</a>)
 </pre>
 
 This builds an executable from a set of source files,
-        which must all be in the `main` package. You can run the binary with
-        `bazel run`, or you can build it with `bazel build` and run it directly.<br><br>
-        ***Note:*** `name` should be the same as the desired name of the generated binary.<br><br>
-        **Providers:**
-        <ul>
-          <li>[GoArchive]</li>
-        </ul>
-        
+which must all be in the `main` package. You can run the binary with
+`bazel run`, or you can build it with `bazel build` and run it directly.<br><br>
+***Note:*** `name` should be the same as the desired name of the generated binary.<br><br>
+**Providers:**
+<ul>
+  <li>[GoArchive]</li>
+</ul>
 
-### **Attributes**
+**ATTRIBUTES**
 
 
 | Name  | Description | Type | Mandatory | Default |
 | :------------- | :------------- | :------------- | :------------- | :------------- |
 | <a id="go_binary-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
-| <a id="go_binary-basename"></a>basename |  The basename of this binary. The binary                 basename may also be platform-dependent: on Windows, we add an .exe extension.   | String | optional | "" |
-| <a id="go_binary-cdeps"></a>cdeps |  The list of other libraries that the c code depends on.                 This can be anything that would be allowed in [cc_library deps]                 Only valid if <code>cgo</code> = <code>True</code>.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_binary-cgo"></a>cgo |  If <code>True</code>, the package may contain [cgo] code, and <code>srcs</code> may contain                 C, C++, Objective-C, and Objective-C++ files and non-Go assembly files.                 When cgo is enabled, these files will be compiled with the C/C++ toolchain                 and included in the package. Note that this attribute does not force cgo                 to be enabled. Cgo is enabled for non-cross-compiling builds when a C/C++                 toolchain is configured.   | Boolean | optional | False |
-| <a id="go_binary-clinkopts"></a>clinkopts |  List of flags to add to the C link command.                 Subject to ["Make variable"] substitution and [Bourne shell tokenization].                 Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_binary-copts"></a>copts |  List of flags to add to the C compilation command.                 Subject to ["Make variable"] substitution and [Bourne shell tokenization].                 Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_binary-cppopts"></a>cppopts |  List of flags to add to the C/C++ preprocessor command.                 Subject to ["Make variable"] substitution and [Bourne shell tokenization].                 Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_binary-cxxopts"></a>cxxopts |  List of flags to add to the C++ compilation command.                 Subject to ["Make variable"] substitution and [Bourne shell tokenization].                 Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_binary-data"></a>data |  List of files needed by this rule at run-time. This may include data files                 needed or other programs that may be executed. The [bazel] package may be                 used to locate run files; they may appear in different places depending on the                 operating system and environment. See [data dependencies] for more                 information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_binary-deps"></a>deps |  List of Go libraries this package imports directly.                 These may be <code>go_library</code> rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_binary-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this                 binary's sources. Labels listed here must name <code>go_library</code>,                 <code>go_proto_library</code>, or other compatible targets with the [GoInfo] provider.                 Embedded libraries must all have the same <code>importpath</code>,                 which must match the <code>importpath</code> for this <code>go_binary</code> if one is                 specified. At most one embedded library may have <code>cgo = True</code>, and the                 embedding binary may not also have <code>cgo = True</code>. See [Embedding] for                 more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_binary-embedsrcs"></a>embedsrcs |  The list of files that may be embedded into the compiled package using                 <code>//go:embed</code> directives. All files must be in the same logical directory                 or a subdirectory as source files. All source files containing <code>//go:embed</code>                 directives must be in the same logical directory. It's okay to mix static and                 generated source files and static and generated embeddable files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_binary-env"></a>env |  Environment variables to set when the binary is executed with bazel run.                 The values (but not keys) are subject to                 [location expansion](https://docs.bazel.build/versions/main/skylark/macros.html) but not full                 [make variable expansion](https://docs.bazel.build/versions/main/be/make-variables.html).   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional | {} |
-| <a id="go_binary-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler.                 Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional | [] |
-| <a id="go_binary-gc_linkopts"></a>gc_linkopts |  List of flags to add to the Go link command when using the gc compiler.                 Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional | [] |
-| <a id="go_binary-goarch"></a>goarch |  Forces a binary to be cross-compiled for a specific architecture. It's usually                 better to control this on the command line with <code>--platforms</code>.<br><br>                This disables cgo by default, since a cross-compiling C/C++ toolchain is                 rarely available. To force cgo, set <code>pure</code> = <code>off</code>.<br><br>                See [Cross compilation] for more information.   | String | optional | "auto" |
-| <a id="go_binary-goos"></a>goos |  Forces a binary to be cross-compiled for a specific operating system. It's                 usually better to control this on the command line with <code>--platforms</code>.<br><br>                This disables cgo by default, since a cross-compiling C/C++ toolchain is                 rarely available. To force cgo, set <code>pure</code> = <code>off</code>.<br><br>                See [Cross compilation] for more information.   | String | optional | "auto" |
-| <a id="go_binary-gotags"></a>gotags |  Enables a list of build tags when evaluating [build constraints]. Useful for                 conditional compilation.   | List of strings | optional | [] |
-| <a id="go_binary-importpath"></a>importpath |  The import path of this binary. Binaries can't actually be imported, but this                 may be used by [go_path] and other tools to report the location of source                 files. This may be inferred from embedded libraries.   | String | optional | "" |
-| <a id="go_binary-linkmode"></a>linkmode |  Determines how the binary should be built and linked. This accepts some of                 the same values as `go build -buildmode` and works the same way.                 <br><br>                 <ul>                 <li>`auto` (default): Controlled by `//go/config:linkmode`, which defaults to `pie` on supported platforms and `normal` elsewhere.</li>                 <li>`normal`: Builds a normal executable with position-dependent code.</li>                 <li>`pie`: Builds a position-independent executable.</li>                 <li>`plugin`: Builds a shared library that can be loaded as a Go plugin. Only supported on platforms that support plugins.</li>                 <li>`c-shared`: Builds a shared library that can be linked into a C program.</li>                 <li>`c-archive`: Builds an archive that can be linked into a C program.</li>                 </ul>   | String | optional | "auto" |
-| <a id="go_binary-msan"></a>msan |  Controls whether code is instrumented for memory sanitization. May be one of                 <code>on</code>, <code>off</code>, or <code>auto</code>. Not available when cgo is                 disabled. In most cases, it's better to control this on the command line with                 <code>--@io_bazel_rules_go//go/config:msan</code>. See [mode attributes], specifically                 [msan].   | String | optional | "auto" |
-| <a id="go_binary-out"></a>out |  Sets the output filename for the generated executable. When set, <code>go_binary</code>                 will write this file without mode-specific directory prefixes, without                 linkmode-specific prefixes like "lib", and without platform-specific suffixes                 like ".exe". Note that without a mode-specific directory prefix, the                 output file (but not its dependencies) will be invalidated in Bazel's cache                 when changing configurations.   | String | optional | "" |
-| <a id="go_binary-pgoprofile"></a>pgoprofile |  Provides a pprof file to be used for profile guided optimization when compiling go targets.                 A pprof file can also be provided via <code>--@io_bazel_rules_go//go/config:pgoprofile=&lt;label of a pprof file&gt;</code>.                 Profile guided optimization is only supported on go 1.20+.                 See https://go.dev/doc/pgo for more information.   | <a href="https://bazel.build/concepts/labels">Label</a> | optional | //go/config:empty |
-| <a id="go_binary-pure"></a>pure |  Controls whether cgo source code and dependencies are compiled and linked,                 similar to setting <code>CGO_ENABLED</code>. May be one of <code>on</code>, <code>off</code>,                 or <code>auto</code>. If <code>auto</code>, pure mode is enabled when no C/C++                 toolchain is configured or when cross-compiling. It's usually better to                 control this on the command line with                 <code>--@io_bazel_rules_go//go/config:pure</code>. See [mode attributes], specifically                 [pure].   | String | optional | "auto" |
-| <a id="go_binary-race"></a>race |  Controls whether code is instrumented for race detection. May be one of                 <code>on</code>, <code>off</code>, or <code>auto</code>. Not available when cgo is                 disabled. In most cases, it's better to control this on the command line with                 <code>--@io_bazel_rules_go//go/config:race</code>. See [mode attributes], specifically                 [race].   | String | optional | "auto" |
-| <a id="go_binary-srcs"></a>srcs |  The list of Go source files that are compiled to create the package.                 Only <code>.go</code>, <code>.s</code>, and <code>.syso</code> files are permitted, unless the <code>cgo</code>                 attribute is set, in which case,                 <code>.c .cc .cpp .cxx .h .hh .hpp .hxx .inc .m .mm</code>                 files are also permitted. Files may be filtered at build time                 using Go [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_binary-static"></a>static |  Controls whether a binary is statically linked. May be one of <code>on</code>,                 <code>off</code>, or <code>auto</code>. Not available on all platforms or in all                 modes. It's usually better to control this on the command line with                 <code>--@io_bazel_rules_go//go/config:static</code>. See [mode attributes],                 specifically [static].   | String | optional | "auto" |
-| <a id="go_binary-x_defs"></a>x_defs |  Map of defines to add to the go link command.                 See [Defines and stamping] for examples of how to use these.   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional | {} |
+| <a id="go_binary-deps"></a>deps |  List of Go libraries this package imports directly. These may be `go_library` rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_binary-srcs"></a>srcs |  The list of Go source files that are compiled to create the package. Only `.go`, `.s`, and `.syso` files are permitted, unless the `cgo` attribute is set, in which case, `.c .cc .cpp .cxx .h .hh .hpp .hxx .inc .m .mm` files are also permitted. Files may be filtered at build time using Go [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_binary-data"></a>data |  List of files needed by this rule at run-time. This may include data files needed or other programs that may be executed. The [bazel] package may be used to locate run files; they may appear in different places depending on the operating system and environment. See [data dependencies] for more information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_binary-out"></a>out |  Sets the output filename for the generated executable. When set, `go_binary` will write this file without mode-specific directory prefixes, without linkmode-specific prefixes like "lib", and without platform-specific suffixes like ".exe". Note that without a mode-specific directory prefix, the output file (but not its dependencies) will be invalidated in Bazel's cache when changing configurations.   | String | optional |  `""`  |
+| <a id="go_binary-basename"></a>basename |  The basename of this binary. The binary basename may also be platform-dependent: on Windows, we add an .exe extension.   | String | optional |  `""`  |
+| <a id="go_binary-cdeps"></a>cdeps |  The list of other libraries that the c code depends on. This can be anything that would be allowed in [cc_library deps] Only valid if `cgo` = `True`.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_binary-cgo"></a>cgo |  If `True`, the package may contain [cgo] code, and `srcs` may contain C, C++, Objective-C, and Objective-C++ files and non-Go assembly files. When cgo is enabled, these files will be compiled with the C/C++ toolchain and included in the package. Note that this attribute does not force cgo to be enabled. Cgo is enabled for non-cross-compiling builds when a C/C++ toolchain is configured.   | Boolean | optional |  `False`  |
+| <a id="go_binary-clinkopts"></a>clinkopts |  List of flags to add to the C link command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_binary-copts"></a>copts |  List of flags to add to the C compilation command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_binary-cppopts"></a>cppopts |  List of flags to add to the C/C++ preprocessor command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_binary-cxxopts"></a>cxxopts |  List of flags to add to the C++ compilation command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_binary-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this binary's sources. Labels listed here must name `go_library`, `go_proto_library`, or other compatible targets with the [GoInfo] provider. Embedded libraries must all have the same `importpath`, which must match the `importpath` for this `go_binary` if one is specified. At most one embedded library may have `cgo = True`, and the embedding binary may not also have `cgo = True`. See [Embedding] for more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_binary-embedsrcs"></a>embedsrcs |  The list of files that may be embedded into the compiled package using `//go:embed` directives. All files must be in the same logical directory or a subdirectory as source files. All source files containing `//go:embed` directives must be in the same logical directory. It's okay to mix static and generated source files and static and generated embeddable files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_binary-env"></a>env |  Environment variables to set when the binary is executed with bazel run. The values (but not keys) are subject to [location expansion](https://docs.bazel.build/versions/main/skylark/macros.html) but not full [make variable expansion](https://docs.bazel.build/versions/main/be/make-variables.html).   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional |  `{}`  |
+| <a id="go_binary-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler. Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional |  `[]`  |
+| <a id="go_binary-gc_linkopts"></a>gc_linkopts |  List of flags to add to the Go link command when using the gc compiler. Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional |  `[]`  |
+| <a id="go_binary-goarch"></a>goarch |  Forces a binary to be cross-compiled for a specific architecture. It's usually better to control this on the command line with `--platforms`.<br><br>This disables cgo by default, since a cross-compiling C/C++ toolchain is rarely available. To force cgo, set `pure` = `off`.<br><br>See [Cross compilation] for more information.   | String | optional |  `"auto"`  |
+| <a id="go_binary-goos"></a>goos |  Forces a binary to be cross-compiled for a specific operating system. It's usually better to control this on the command line with `--platforms`.<br><br>This disables cgo by default, since a cross-compiling C/C++ toolchain is rarely available. To force cgo, set `pure` = `off`.<br><br>See [Cross compilation] for more information.   | String | optional |  `"auto"`  |
+| <a id="go_binary-gotags"></a>gotags |  Enables a list of build tags when evaluating [build constraints]. Useful for conditional compilation.   | List of strings | optional |  `[]`  |
+| <a id="go_binary-importpath"></a>importpath |  The import path of this binary. Binaries can't actually be imported, but this may be used by [go_path] and other tools to report the location of source files. This may be inferred from embedded libraries.   | String | optional |  `""`  |
+| <a id="go_binary-linkmode"></a>linkmode |  Determines how the binary should be built and linked. This accepts some of the same values as `go build -buildmode` and works the same way. <br><br> <ul> <li>`auto` (default): Controlled by `//go/config:linkmode`, which defaults to `pie` on supported platforms and `normal` elsewhere.</li> <li>`normal`: Builds a normal executable with position-dependent code.</li> <li>`pie`: Builds a position-independent executable.</li> <li>`plugin`: Builds a shared library that can be loaded as a Go plugin. Only supported on platforms that support plugins.</li> <li>`c-shared`: Builds a shared library that can be linked into a C program.</li> <li>`c-archive`: Builds an archive that can be linked into a C program.</li> </ul>   | String | optional |  `"auto"`  |
+| <a id="go_binary-msan"></a>msan |  Controls whether code is instrumented for memory sanitization. May be one of `on`, `off`, or `auto`. Not available when cgo is disabled. In most cases, it's better to control this on the command line with `--@io_bazel_rules_go//go/config:msan`. See [mode attributes], specifically [msan].   | String | optional |  `"auto"`  |
+| <a id="go_binary-pgoprofile"></a>pgoprofile |  Provides a pprof file to be used for profile guided optimization when compiling go targets. A pprof file can also be provided via `--@io_bazel_rules_go//go/config:pgoprofile=<label of a pprof file>`. Profile guided optimization is only supported on go 1.20+. See https://go.dev/doc/pgo for more information.   | <a href="https://bazel.build/concepts/labels">Label</a> | optional |  `"@rules_go//go/config:empty"`  |
+| <a id="go_binary-pure"></a>pure |  Controls whether cgo source code and dependencies are compiled and linked, similar to setting `CGO_ENABLED`. May be one of `on`, `off`, or `auto`. If `auto`, pure mode is enabled when no C/C++ toolchain is configured or when cross-compiling. It's usually better to control this on the command line with `--@io_bazel_rules_go//go/config:pure`. See [mode attributes], specifically [pure].   | String | optional |  `"auto"`  |
+| <a id="go_binary-race"></a>race |  Controls whether code is instrumented for race detection. May be one of `on`, `off`, or `auto`. Not available when cgo is disabled. In most cases, it's better to control this on the command line with `--@io_bazel_rules_go//go/config:race`. See [mode attributes], specifically [race].   | String | optional |  `"auto"`  |
+| <a id="go_binary-static"></a>static |  Controls whether a binary is statically linked. May be one of `on`, `off`, or `auto`. Not available on all platforms or in all modes. It's usually better to control this on the command line with `--@io_bazel_rules_go//go/config:static`. See [mode attributes], specifically [static].   | String | optional |  `"auto"`  |
+| <a id="go_binary-x_defs"></a>x_defs |  Map of defines to add to the go link command. See [Defines and stamping] for examples of how to use these.   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional |  `{}`  |
 
 
-
-
-
-<a id="#go_cross_binary"></a>
+<a id="go_cross_binary"></a>
 
 ## go_cross_binary
 
 <pre>
+load("@rules_go//docs/go/core:rules.bzl", "go_cross_binary")
+
 go_cross_binary(<a href="#go_cross_binary-name">name</a>, <a href="#go_cross_binary-compilation_mode">compilation_mode</a>, <a href="#go_cross_binary-platform">platform</a>, <a href="#go_cross_binary-sdk_version">sdk_version</a>, <a href="#go_cross_binary-target">target</a>)
 </pre>
 
 This wraps an executable built by `go_binary` to cross compile it
-    for a different platform, and/or compile it using a different version
-    of the golang SDK.<br><br>
-    **Providers:**
-    <ul>
-      <li>[GoArchive]</li>
-    </ul>
-    
+for a different platform, and/or compile it using a different version
+of the golang SDK.<br><br>
+**Providers:**
+<ul>
+  <li>[GoArchive]</li>
+</ul>
 
-### **Attributes**
+**ATTRIBUTES**
 
 
 | Name  | Description | Type | Mandatory | Default |
 | :------------- | :------------- | :------------- | :------------- | :------------- |
 | <a id="go_cross_binary-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
-| <a id="go_cross_binary-compilation_mode"></a>compilation_mode |  The compilation_mode to use for compiling the <code>target</code>.             Must be one of <code>dbg</code>, <code>fastbuild</code>, or <code>opt</code>. If unspecified, use the             same compilation mode as the original <code>go_binary</code> rule.   | String | optional | "" |
-| <a id="go_cross_binary-platform"></a>platform |  The platform to cross compile the <code>target</code> for.             If unspecified, the <code>target</code> will be compiled with the             same platform as it would've with the original <code>go_binary</code> rule.   | <a href="https://bazel.build/concepts/labels">Label</a> | optional | None |
-| <a id="go_cross_binary-sdk_version"></a>sdk_version |  The golang SDK version to use for compiling the <code>target</code>.             Supports specifying major, minor, and/or patch versions, eg. <code>"1"</code>,             <code>"1.17"</code>, or <code>"1.17.1"</code>. The first Go SDK provider installed in the             repo's workspace (via <code>go_download_sdk</code>, <code>go_wrap_sdk</code>, etc) that             matches the specified version will be used for compiling the given             <code>target</code>. If unspecified, the <code>target</code> will be compiled with the same             SDK as it would've with the original <code>go_binary</code> rule.             Transitions <code>target</code> by changing the <code>--@io_bazel_rules_go//go/toolchain:sdk_version</code>             build flag to the value provided for <code>sdk_version</code> here.   | String | optional | "" |
+| <a id="go_cross_binary-compilation_mode"></a>compilation_mode |  The compilation_mode to use for compiling the `target`. Must be one of `dbg`, `fastbuild`, or `opt`. If unspecified, use the same compilation mode as the original `go_binary` rule.   | String | optional |  `""`  |
+| <a id="go_cross_binary-platform"></a>platform |  The platform to cross compile the `target` for. If unspecified, the `target` will be compiled with the same platform as it would've with the original `go_binary` rule.   | <a href="https://bazel.build/concepts/labels">Label</a> | optional |  `None`  |
+| <a id="go_cross_binary-sdk_version"></a>sdk_version |  The golang SDK version to use for compiling the `target`. Supports specifying major, minor, and/or patch versions, eg. `"1"`, `"1.17"`, or `"1.17.1"`. The first Go SDK provider installed in the repo's workspace (via `go_download_sdk`, `go_wrap_sdk`, etc) that matches the specified version will be used for compiling the given `target`. If unspecified, the `target` will be compiled with the same SDK as it would've with the original `go_binary` rule. Transitions `target` by changing the `--@io_bazel_rules_go//go/toolchain:sdk_version` build flag to the value provided for `sdk_version` here.   | String | optional |  `""`  |
 | <a id="go_cross_binary-target"></a>target |  Go binary target to transition to the given platform and/or sdk_version.   | <a href="https://bazel.build/concepts/labels">Label</a> | required |  |
 
 
-
-
-
-<a id="#go_library"></a>
+<a id="go_library"></a>
 
 ## go_library
 
 <pre>
-go_library(<a href="#go_library-name">name</a>, <a href="#go_library-cdeps">cdeps</a>, <a href="#go_library-cgo">cgo</a>, <a href="#go_library-clinkopts">clinkopts</a>, <a href="#go_library-copts">copts</a>, <a href="#go_library-cppopts">cppopts</a>, <a href="#go_library-cxxopts">cxxopts</a>, <a href="#go_library-data">data</a>, <a href="#go_library-deps">deps</a>, <a href="#go_library-embed">embed</a>, <a href="#go_library-embedsrcs">embedsrcs</a>,
-           <a href="#go_library-gc_goopts">gc_goopts</a>, <a href="#go_library-importmap">importmap</a>, <a href="#go_library-importpath">importpath</a>, <a href="#go_library-importpath_aliases">importpath_aliases</a>, <a href="#go_library-srcs">srcs</a>, <a href="#go_library-x_defs">x_defs</a>)
+load("@rules_go//docs/go/core:rules.bzl", "go_library")
+
+go_library(<a href="#go_library-name">name</a>, <a href="#go_library-deps">deps</a>, <a href="#go_library-srcs">srcs</a>, <a href="#go_library-data">data</a>, <a href="#go_library-cdeps">cdeps</a>, <a href="#go_library-cgo">cgo</a>, <a href="#go_library-clinkopts">clinkopts</a>, <a href="#go_library-copts">copts</a>, <a href="#go_library-cppopts">cppopts</a>, <a href="#go_library-cxxopts">cxxopts</a>, <a href="#go_library-embed">embed</a>, <a href="#go_library-embedsrcs">embedsrcs</a>,
+           <a href="#go_library-gc_goopts">gc_goopts</a>, <a href="#go_library-importmap">importmap</a>, <a href="#go_library-importpath">importpath</a>, <a href="#go_library-importpath_aliases">importpath_aliases</a>, <a href="#go_library-x_defs">x_defs</a>)
 </pre>
 
 This builds a Go library from a set of source files that are all part of
-    the same package.<br><br>
-    ***Note:*** For targets generated by Gazelle, `name` is typically the last component of the path,
-    or `go_default_library`, with the old naming convention.<br><br>
-    **Providers:**
-    <ul>
-      <li>[GoInfo]</li>
-      <li>[GoArchive]</li>
-    </ul>
-    
+the same package.<br><br>
+***Note:*** For targets generated by Gazelle, `name` is typically the last component of the path,
+or `go_default_library`, with the old naming convention.<br><br>
+**Providers:**
+<ul>
+  <li>[GoInfo]</li>
+  <li>[GoArchive]</li>
+</ul>
 
-### **Attributes**
+**ATTRIBUTES**
 
 
 | Name  | Description | Type | Mandatory | Default |
 | :------------- | :------------- | :------------- | :------------- | :------------- |
 | <a id="go_library-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
-| <a id="go_library-cdeps"></a>cdeps |  List of other libraries that the c code depends on.             This can be anything that would be allowed in [cc_library deps] Only valid if <code>cgo = True</code>.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_library-cgo"></a>cgo |  If <code>True</code>, the package may contain [cgo] code, and <code>srcs</code> may contain C, C++, Objective-C, and Objective-C++ files             and non-Go assembly files. When cgo is enabled, these files will be compiled with the C/C++ toolchain and             included in the package. Note that this attribute does not force cgo to be enabled. Cgo is enabled for             non-cross-compiling builds when a C/C++ toolchain is configured.   | Boolean | optional | False |
-| <a id="go_library-clinkopts"></a>clinkopts |  List of flags to add to the C link command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if <code>cgo = True</code>.   | List of strings | optional | [] |
-| <a id="go_library-copts"></a>copts |  List of flags to add to the C compilation command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if <code>cgo = True</code>.   | List of strings | optional | [] |
-| <a id="go_library-cppopts"></a>cppopts |  List of flags to add to the C/C++ preprocessor command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].             Only valid if <code>cgo = True</code>.   | List of strings | optional | [] |
-| <a id="go_library-cxxopts"></a>cxxopts |  List of flags to add to the C++ compilation command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if <code>cgo = True</code>.   | List of strings | optional | [] |
-| <a id="go_library-data"></a>data |  List of files needed by this rule at run-time.             This may include data files needed or other programs that may be executed.             The [bazel] package may be used to locate run files; they may appear in different places             depending on the operating system and environment. See [data dependencies] for more information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_library-deps"></a>deps |  List of Go libraries this package imports directly.             These may be <code>go_library</code> rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_library-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this package's sources.             Labels listed here must name <code>go_library</code>, <code>go_proto_library</code>, or other compatible targets with             the [GoInfo] provider. Embedded libraries must have the same <code>importpath</code> as the embedding library.             At most one embedded library may have <code>cgo = True</code>, and the embedding library may not also have <code>cgo = True</code>.             See [Embedding] for more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_library-embedsrcs"></a>embedsrcs |  The list of files that may be embedded into the compiled package using <code>//go:embed</code>             directives. All files must be in the same logical directory or a subdirectory as source files.             All source files containing <code>//go:embed</code> directives must be in the same logical directory.             It's okay to mix static and generated source files and static and generated embeddable files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_library-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional | [] |
-| <a id="go_library-importmap"></a>importmap |  The actual import path of this library. By default, this is <code>importpath</code>. This is mostly only visible to the compiler and linker,             but it may also be seen in stack traces. This must be unique among packages passed to the linker.             It may be set to something different than <code>importpath</code> to prevent conflicts between multiple packages             with the same path (for example, from different vendor directories).   | String | optional | "" |
-| <a id="go_library-importpath"></a>importpath |  The source import path of this library. Other libraries can import this library using this path.             This must either be specified in <code>go_library</code> or inherited from one of the libraries in <code>embed</code>.   | String | optional | "" |
-| <a id="go_library-importpath_aliases"></a>importpath_aliases |  -   | List of strings | optional | [] |
-| <a id="go_library-srcs"></a>srcs |  The list of Go source files that are compiled to create the package.             Only <code>.go</code>, <code>.s</code>, and <code>.syso</code> files are permitted, unless the <code>cgo</code> attribute is set,             in which case, <code>.c .cc .cpp .cxx .h .hh .hpp .hxx .inc .m .mm</code> files are also permitted.             Files may be filtered at build time using Go [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_library-x_defs"></a>x_defs |  Map of defines to add to the go link command. See [Defines and stamping] for examples of how to use these.   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional | {} |
+| <a id="go_library-deps"></a>deps |  List of Go libraries this package imports directly. These may be `go_library` rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_library-srcs"></a>srcs |  The list of Go source files that are compiled to create the package. Only `.go`, `.s`, and `.syso` files are permitted, unless the `cgo` attribute is set, in which case, `.c .cc .cpp .cxx .h .hh .hpp .hxx .inc .m .mm` files are also permitted. Files may be filtered at build time using Go [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_library-data"></a>data |  List of files needed by this rule at run-time. This may include data files needed or other programs that may be executed. The [bazel] package may be used to locate run files; they may appear in different places depending on the operating system and environment. See [data dependencies] for more information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_library-cdeps"></a>cdeps |  List of other libraries that the c code depends on. This can be anything that would be allowed in [cc_library deps] Only valid if `cgo = True`.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_library-cgo"></a>cgo |  If `True`, the package may contain [cgo] code, and `srcs` may contain C, C++, Objective-C, and Objective-C++ files and non-Go assembly files. When cgo is enabled, these files will be compiled with the C/C++ toolchain and included in the package. Note that this attribute does not force cgo to be enabled. Cgo is enabled for non-cross-compiling builds when a C/C++ toolchain is configured.   | Boolean | optional |  `False`  |
+| <a id="go_library-clinkopts"></a>clinkopts |  List of flags to add to the C link command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo = True`.   | List of strings | optional |  `[]`  |
+| <a id="go_library-copts"></a>copts |  List of flags to add to the C compilation command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo = True`.   | List of strings | optional |  `[]`  |
+| <a id="go_library-cppopts"></a>cppopts |  List of flags to add to the C/C++ preprocessor command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo = True`.   | List of strings | optional |  `[]`  |
+| <a id="go_library-cxxopts"></a>cxxopts |  List of flags to add to the C++ compilation command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo = True`.   | List of strings | optional |  `[]`  |
+| <a id="go_library-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this package's sources. Labels listed here must name `go_library`, `go_proto_library`, or other compatible targets with the [GoInfo] provider. Embedded libraries must have the same `importpath` as the embedding library. At most one embedded library may have `cgo = True`, and the embedding library may not also have `cgo = True`. See [Embedding] for more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_library-embedsrcs"></a>embedsrcs |  The list of files that may be embedded into the compiled package using `//go:embed` directives. All files must be in the same logical directory or a subdirectory as source files. All source files containing `//go:embed` directives must be in the same logical directory. It's okay to mix static and generated source files and static and generated embeddable files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_library-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler. Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional |  `[]`  |
+| <a id="go_library-importmap"></a>importmap |  The actual import path of this library. By default, this is `importpath`. This is mostly only visible to the compiler and linker, but it may also be seen in stack traces. This must be unique among packages passed to the linker. It may be set to something different than `importpath` to prevent conflicts between multiple packages with the same path (for example, from different vendor directories).   | String | optional |  `""`  |
+| <a id="go_library-importpath"></a>importpath |  The source import path of this library. Other libraries can import this library using this path. This must either be specified in `go_library` or inherited from one of the libraries in `embed`.   | String | optional |  `""`  |
+| <a id="go_library-importpath_aliases"></a>importpath_aliases |  -   | List of strings | optional |  `[]`  |
+| <a id="go_library-x_defs"></a>x_defs |  Map of defines to add to the go link command. See [Defines and stamping] for examples of how to use these.   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional |  `{}`  |
 
 
-
-
-
-<a id="#go_path"></a>
+<a id="go_path"></a>
 
 ## go_path
 
 <pre>
-go_path(<a href="#go_path-name">name</a>, <a href="#go_path-data">data</a>, <a href="#go_path-deps">deps</a>, <a href="#go_path-include_data">include_data</a>, <a href="#go_path-include_pkg">include_pkg</a>, <a href="#go_path-include_transitive">include_transitive</a>, <a href="#go_path-mode">mode</a>)
+load("@rules_go//docs/go/core:rules.bzl", "go_path")
+
+go_path(<a href="#go_path-name">name</a>, <a href="#go_path-deps">deps</a>, <a href="#go_path-data">data</a>, <a href="#go_path-include_data">include_data</a>, <a href="#go_path-include_pkg">include_pkg</a>, <a href="#go_path-include_transitive">include_transitive</a>, <a href="#go_path-mode">mode</a>)
 </pre>
 
 `go_path` builds a directory structure that can be used with
-    tools that understand the GOPATH directory layout. This directory structure
-    can be built by zipping, copying, or linking files.
-    `go_path` can depend on one or more Go targets (i.e., [go_library], [go_binary], or [go_test]).
-    It will include packages from those targets, as well as their transitive dependencies.
-    Packages will be in subdirectories named after their `importpath` or `importmap` attributes under a `src/` directory.
-    
+tools that understand the GOPATH directory layout. This directory structure
+can be built by zipping, copying, or linking files.
+`go_path` can depend on one or more Go targets (i.e., [go_library], [go_binary], or [go_test]).
+It will include packages from those targets, as well as their transitive dependencies.
+Packages will be in subdirectories named after their `importpath` or `importmap` attributes under a `src/` directory.
 
-### **Attributes**
+**ATTRIBUTES**
 
 
 | Name  | Description | Type | Mandatory | Default |
 | :------------- | :------------- | :------------- | :------------- | :------------- |
 | <a id="go_path-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
-| <a id="go_path-data"></a>data |  A list of targets producing data files that will be stored next to the             <code>src/</code> directory. Useful for including things like licenses and readmes.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_path-deps"></a>deps |  A list of targets that build Go packages. A directory will be generated from             files in these targets and their transitive dependencies. All targets must             provide [GoArchive] ([go_library], [go_binary], [go_test], and similar             rules have this).<br><br>            Only targets with explicit <code>importpath</code> attributes will be included in the             generated directory. Synthetic packages (like the main package produced by             [go_test]) and packages with inferred import paths will not be             included. The values of <code>importmap</code> attributes may influence the placement             of packages within the generated directory (for example, in vendor             directories).<br><br>            The generated directory will contain original source files, including .go,             .s, .h, and .c files compiled by cgo. It will not contain files generated by             tools like cover and cgo, but it will contain generated files passed in             <code>srcs</code> attributes like .pb.go files. The generated directory will also             contain runfiles found in <code>data</code> attributes.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_path-include_data"></a>include_data |  When true, data files referenced by libraries, binaries, and tests will be             included in the output directory. Files listed in the <code>data</code> attribute             for this rule will be included regardless of this attribute.   | Boolean | optional | True |
-| <a id="go_path-include_pkg"></a>include_pkg |  When true, a <code>pkg</code> subdirectory containing the compiled libraries will be created in the             generated <code>GOPATH</code> containing compiled libraries.   | Boolean | optional | False |
-| <a id="go_path-include_transitive"></a>include_transitive |  When true, the transitive dependency graph will be included in the generated <code>GOPATH</code>. This is             the default behaviour. When false, only the direct dependencies will be included in the             generated <code>GOPATH</code>.   | Boolean | optional | True |
-| <a id="go_path-mode"></a>mode |  Determines how the generated directory is provided. May be one of:             <ul>                 <li><code>"archive"</code>: The generated directory is packaged as a single .zip file.</li>                 <li><code>"copy"</code>: The generated directory is a single tree artifact. Source files                 are copied into the tree.</li>                 <li><code>"link"</code>: <b>Unmaintained due to correctness issues</b>. Source files                 are symlinked into the tree. All of the symlink files are provided as separate output                 files.</li>             </ul>              ***Note:*** In <code>"copy"</code> mode, when a <code>GoPath</code> is consumed as a set of input             files or run files, Bazel may provide symbolic links instead of regular files.             Any program that consumes these files should dereference links, e.g., if you             run <code>tar</code>, use the <code>--dereference</code> flag.   | String | optional | "copy" |
+| <a id="go_path-deps"></a>deps |  A list of targets that build Go packages. A directory will be generated from files in these targets and their transitive dependencies. All targets must provide [GoArchive] ([go_library], [go_binary], [go_test], and similar rules have this).<br><br>Only targets with explicit `importpath` attributes will be included in the generated directory. Synthetic packages (like the main package produced by [go_test]) and packages with inferred import paths will not be included. The values of `importmap` attributes may influence the placement of packages within the generated directory (for example, in vendor directories).<br><br>The generated directory will contain original source files, including .go, .s, .h, and .c files compiled by cgo. It will not contain files generated by tools like cover and cgo, but it will contain generated files passed in `srcs` attributes like .pb.go files. The generated directory will also contain runfiles found in `data` attributes.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_path-data"></a>data |  A list of targets producing data files that will be stored next to the `src/` directory. Useful for including things like licenses and readmes.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_path-include_data"></a>include_data |  When true, data files referenced by libraries, binaries, and tests will be included in the output directory. Files listed in the `data` attribute for this rule will be included regardless of this attribute.   | Boolean | optional |  `True`  |
+| <a id="go_path-include_pkg"></a>include_pkg |  When true, a `pkg` subdirectory containing the compiled libraries will be created in the generated `GOPATH` containing compiled libraries.   | Boolean | optional |  `False`  |
+| <a id="go_path-include_transitive"></a>include_transitive |  When true, the transitive dependency graph will be included in the generated `GOPATH`. This is the default behaviour. When false, only the direct dependencies will be included in the generated `GOPATH`.   | Boolean | optional |  `True`  |
+| <a id="go_path-mode"></a>mode |  Determines how the generated directory is provided. May be one of: <ul>     <li><code>"archive"</code>: The generated directory is packaged as a single .zip file.</li>     <li><code>"copy"</code>: The generated directory is a single tree artifact. Source files     are copied into the tree.</li>     <li><code>"link"</code>: <b>Unmaintained due to correctness issues</b>. Source files     are symlinked into the tree. All of the symlink files are provided as separate output     files.</li> </ul><br><br>***Note:*** In <code>"copy"</code> mode, when a <code>GoPath</code> is consumed as a set of input files or run files, Bazel may provide symbolic links instead of regular files. Any program that consumes these files should dereference links, e.g., if you run <code>tar</code>, use the <code>--dereference</code> flag.   | String | optional |  `"copy"`  |
 
 
-
-
-
-<a id="#go_reset_target"></a>
+<a id="go_reset_target"></a>
 
 ## go_reset_target
 
 <pre>
+load("@rules_go//docs/go/core:rules.bzl", "go_reset_target")
+
 go_reset_target(<a href="#go_reset_target-name">name</a>, <a href="#go_reset_target-dep">dep</a>)
 </pre>
 
@@ -311,8 +299,7 @@
 a tool isn't built as a shared library with race instrumentation. This acts as an
 intermediate rule that allows users to apply these transitions.
 
-
-### **Attributes**
+**ATTRIBUTES**
 
 
 | Name  | Description | Type | Mandatory | Default |
@@ -321,114 +308,110 @@
 | <a id="go_reset_target-dep"></a>dep |  The target to forward providers from and apply go_tool_transition to.   | <a href="https://bazel.build/concepts/labels">Label</a> | required |  |
 
 
-
-
-
-<a id="#go_source"></a>
+<a id="go_source"></a>
 
 ## go_source
 
 <pre>
-go_source(<a href="#go_source-name">name</a>, <a href="#go_source-data">data</a>, <a href="#go_source-deps">deps</a>, <a href="#go_source-embed">embed</a>, <a href="#go_source-gc_goopts">gc_goopts</a>, <a href="#go_source-srcs">srcs</a>)
+load("@rules_go//docs/go/core:rules.bzl", "go_source")
+
+go_source(<a href="#go_source-name">name</a>, <a href="#go_source-deps">deps</a>, <a href="#go_source-srcs">srcs</a>, <a href="#go_source-data">data</a>, <a href="#go_source-embed">embed</a>, <a href="#go_source-gc_goopts">gc_goopts</a>)
 </pre>
 
 This declares a set of source files and related dependencies that can be embedded into one of the
-    other rules.
-    This is used as a way of easily declaring a common set of sources re-used in multiple rules.<br><br>
-    **Providers:**
-    <ul>
-      <li>[GoInfo]</li>
-    </ul>
-    
+other rules.
+This is used as a way of easily declaring a common set of sources re-used in multiple rules.<br><br>
+**Providers:**
+<ul>
+  <li>[GoInfo]</li>
+</ul>
 
-### **Attributes**
+**ATTRIBUTES**
 
 
 | Name  | Description | Type | Mandatory | Default |
 | :------------- | :------------- | :------------- | :------------- | :------------- |
 | <a id="go_source-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
-| <a id="go_source-data"></a>data |  List of files needed by this rule at run-time. This may include data files             needed or other programs that may be executed. The [bazel] package may be             used to locate run files; they may appear in different places depending on the             operating system and environment. See [data dependencies] for more             information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_source-deps"></a>deps |  List of Go libraries this source list imports directly.             These may be go_library rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_source-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this             package's sources. Labels listed here must name <code>go_library</code>,             <code>go_proto_library</code>, or other compatible targets with the [GoInfo]             provider. Embedded libraries must have the same <code>importpath</code> as             the embedding library. At most one embedded library may have <code>cgo = True</code>,             and the embedding library may not also have <code>cgo = True</code>. See [Embedding]             for more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_source-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional | [] |
-| <a id="go_source-srcs"></a>srcs |  The list of Go source files that are compiled to create the package.             The following file types are permitted: <code>.go, .c, .s, .syso, .S, .h</code>.             The files may contain Go-style [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
+| <a id="go_source-deps"></a>deps |  List of Go libraries this source list imports directly. These may be go_library rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_source-srcs"></a>srcs |  The list of Go source files that are compiled to create the package. The following file types are permitted: `.go, .c, .s, .syso, .S, .h`. The files may contain Go-style [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_source-data"></a>data |  List of files needed by this rule at run-time. This may include data files needed or other programs that may be executed. The [bazel] package may be used to locate run files; they may appear in different places depending on the operating system and environment. See [data dependencies] for more information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_source-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this package's sources. Labels listed here must name `go_library`, `go_proto_library`, or other compatible targets with the [GoInfo] provider. Embedded libraries must have the same `importpath` as the embedding library. At most one embedded library may have `cgo = True`, and the embedding library may not also have `cgo = True`. See [Embedding] for more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_source-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler. Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional |  `[]`  |
 
 
-
-
-
-<a id="#go_test"></a>
+<a id="go_test"></a>
 
 ## go_test
 
 <pre>
-go_test(<a href="#go_test-name">name</a>, <a href="#go_test-cdeps">cdeps</a>, <a href="#go_test-cgo">cgo</a>, <a href="#go_test-clinkopts">clinkopts</a>, <a href="#go_test-copts">copts</a>, <a href="#go_test-cppopts">cppopts</a>, <a href="#go_test-cxxopts">cxxopts</a>, <a href="#go_test-data">data</a>, <a href="#go_test-deps">deps</a>, <a href="#go_test-embed">embed</a>, <a href="#go_test-embedsrcs">embedsrcs</a>, <a href="#go_test-env">env</a>,
-        <a href="#go_test-env_inherit">env_inherit</a>, <a href="#go_test-gc_goopts">gc_goopts</a>, <a href="#go_test-gc_linkopts">gc_linkopts</a>, <a href="#go_test-goarch">goarch</a>, <a href="#go_test-goos">goos</a>, <a href="#go_test-gotags">gotags</a>, <a href="#go_test-importpath">importpath</a>, <a href="#go_test-linkmode">linkmode</a>, <a href="#go_test-msan">msan</a>, <a href="#go_test-pure">pure</a>,
-        <a href="#go_test-race">race</a>, <a href="#go_test-rundir">rundir</a>, <a href="#go_test-srcs">srcs</a>, <a href="#go_test-static">static</a>, <a href="#go_test-x_defs">x_defs</a>)
+load("@rules_go//docs/go/core:rules.bzl", "go_test")
+
+go_test(<a href="#go_test-name">name</a>, <a href="#go_test-deps">deps</a>, <a href="#go_test-srcs">srcs</a>, <a href="#go_test-data">data</a>, <a href="#go_test-cdeps">cdeps</a>, <a href="#go_test-cgo">cgo</a>, <a href="#go_test-clinkopts">clinkopts</a>, <a href="#go_test-copts">copts</a>, <a href="#go_test-cppopts">cppopts</a>, <a href="#go_test-cxxopts">cxxopts</a>, <a href="#go_test-embed">embed</a>, <a href="#go_test-embedsrcs">embedsrcs</a>,
+        <a href="#go_test-env">env</a>, <a href="#go_test-env_inherit">env_inherit</a>, <a href="#go_test-gc_goopts">gc_goopts</a>, <a href="#go_test-gc_linkopts">gc_linkopts</a>, <a href="#go_test-goarch">goarch</a>, <a href="#go_test-goos">goos</a>, <a href="#go_test-gotags">gotags</a>, <a href="#go_test-importpath">importpath</a>, <a href="#go_test-linkmode">linkmode</a>, <a href="#go_test-msan">msan</a>,
+        <a href="#go_test-pure">pure</a>, <a href="#go_test-race">race</a>, <a href="#go_test-rundir">rundir</a>, <a href="#go_test-static">static</a>, <a href="#go_test-x_defs">x_defs</a>)
 </pre>
 
 This builds a set of tests that can be run with `bazel test`.<br><br>
-    To run all tests in the workspace, and print output on failure (the
-    equivalent of `go test ./...`), run<br>
-    ```
-    bazel test --test_output=errors //...
-    ```<br><br>
-    To run a Go benchmark test, run<br>
-    ```
-    bazel run //path/to:test -- -test.bench=.
-    ```<br><br>
-    You can run specific tests by passing the `--test_filter=pattern
-    <test_filter_>` argument to Bazel. You can pass arguments to tests by passing
-    `--test_arg=arg <test_arg_>` arguments to Bazel, and you can set environment
-    variables in the test environment by passing
-    `--test_env=VAR=value <test_env_>`. You can terminate test execution after the first
-    failure by passing the `--test_runner_fail_fast <test_runner_fail_fast_>` argument
-    to Bazel. This is equivalent to passing `--test_arg=-failfast <test_arg_>`.<br><br>
-    To write structured testlog information to Bazel's `XML_OUTPUT_FILE`, tests
-    ran with `bazel test` execute using a wrapper. This functionality can be
-    disabled by setting `GO_TEST_WRAP=0` in the test environment. Additionally,
-    the testbinary can be invoked with `-test.v` by setting
-    `GO_TEST_WRAP_TESTV=1` in the test environment; this will result in the
-    `XML_OUTPUT_FILE` containing more granular data.<br><br>
-    ***Note:*** To interoperate cleanly with old targets generated by [Gazelle], `name`
-    should be `go_default_test` for internal tests and
-    `go_default_xtest` for external tests. Gazelle now generates
-    the name  based on the last component of the path. For example, a test
-    in `//foo/bar` is named `bar_test`, and uses internal and external
-    sources.
-    
+To run all tests in the workspace, and print output on failure (the
+equivalent of `go test ./...`), run<br>
+```
+bazel test --test_output=errors //...
+```<br><br>
+To run a Go benchmark test, run<br>
+```
+bazel run //path/to:test -- -test.bench=.
+```<br><br>
+You can run specific tests by passing the `--test_filter=pattern
+<test_filter_>` argument to Bazel. You can pass arguments to tests by passing
+`--test_arg=arg <test_arg_>` arguments to Bazel, and you can set environment
+variables in the test environment by passing
+`--test_env=VAR=value <test_env_>`. You can terminate test execution after the first
+failure by passing the `--test_runner_fail_fast <test_runner_fail_fast_>` argument
+to Bazel. This is equivalent to passing `--test_arg=-failfast <test_arg_>`.<br><br>
+To write structured testlog information to Bazel's `XML_OUTPUT_FILE`, tests
+ran with `bazel test` execute using a wrapper. This functionality can be
+disabled by setting `GO_TEST_WRAP=0` in the test environment. Additionally,
+the testbinary can be invoked with `-test.v` by setting
+`GO_TEST_WRAP_TESTV=1` in the test environment; this will result in the
+`XML_OUTPUT_FILE` containing more granular data.<br><br>
+***Note:*** To interoperate cleanly with old targets generated by [Gazelle], `name`
+should be `go_default_test` for internal tests and
+`go_default_xtest` for external tests. Gazelle now generates
+the name  based on the last component of the path. For example, a test
+in `//foo/bar` is named `bar_test`, and uses internal and external
+sources.
 
-### **Attributes**
+**ATTRIBUTES**
 
 
 | Name  | Description | Type | Mandatory | Default |
 | :------------- | :------------- | :------------- | :------------- | :------------- |
 | <a id="go_test-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
-| <a id="go_test-cdeps"></a>cdeps |  The list of other libraries that the c code depends on.             This can be anything that would be allowed in [cc_library deps]             Only valid if <code>cgo</code> = <code>True</code>.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_test-cgo"></a>cgo |  If <code>True</code>, the package may contain [cgo] code, and <code>srcs</code> may contain             C, C++, Objective-C, and Objective-C++ files and non-Go assembly files.             When cgo is enabled, these files will be compiled with the C/C++ toolchain             and included in the package. Note that this attribute does not force cgo             to be enabled. Cgo is enabled for non-cross-compiling builds when a C/C++             toolchain is configured.   | Boolean | optional | False |
-| <a id="go_test-clinkopts"></a>clinkopts |  List of flags to add to the C link command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].             Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_test-copts"></a>copts |  List of flags to add to the C compilation command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].             Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_test-cppopts"></a>cppopts |  List of flags to add to the C/C++ preprocessor command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].             Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_test-cxxopts"></a>cxxopts |  List of flags to add to the C++ compilation command.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].             Only valid if <code>cgo</code> = <code>True</code>.   | List of strings | optional | [] |
-| <a id="go_test-data"></a>data |  List of files needed by this rule at run-time. This may include data files             needed or other programs that may be executed. The [bazel] package may be             used to locate run files; they may appear in different places depending on the             operating system and environment. See [data dependencies] for more             information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_test-deps"></a>deps |  List of Go libraries this test imports directly.             These may be go_library rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_test-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this             package's sources. Labels listed here must name <code>go_library</code>,             <code>go_proto_library</code>, or other compatible targets with the             [GoInfo] provider. Embedded libraries must have the same <code>importpath</code> as             the embedding library. At most one embedded library may have <code>cgo = True</code>,             and the embedding library may not also have <code>cgo = True</code>. See [Embedding]             for more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_test-embedsrcs"></a>embedsrcs |  The list of files that may be embedded into the compiled package using             <code>//go:embed</code> directives. All files must be in the same logical directory             or a subdirectory as source files. All source files containing <code>//go:embed</code>             directives must be in the same logical directory. It's okay to mix static and             generated source files and static and generated embeddable files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_test-env"></a>env |  Environment variables to set for the test execution.             The values (but not keys) are subject to             [location expansion](https://docs.bazel.build/versions/main/skylark/macros.html) but not full             [make variable expansion](https://docs.bazel.build/versions/main/be/make-variables.html).   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional | {} |
-| <a id="go_test-env_inherit"></a>env_inherit |  Environment variables to inherit from the external environment.   | List of strings | optional | [] |
-| <a id="go_test-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional | [] |
-| <a id="go_test-gc_linkopts"></a>gc_linkopts |  List of flags to add to the Go link command when using the gc compiler.             Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional | [] |
-| <a id="go_test-goarch"></a>goarch |  Forces a binary to be cross-compiled for a specific architecture. It's usually             better to control this on the command line with <code>--platforms</code>.<br><br>            This disables cgo by default, since a cross-compiling C/C++ toolchain is             rarely available. To force cgo, set <code>pure</code> = <code>off</code>.<br><br>            See [Cross compilation] for more information.   | String | optional | "auto" |
-| <a id="go_test-goos"></a>goos |  Forces a binary to be cross-compiled for a specific operating system. It's             usually better to control this on the command line with <code>--platforms</code>.<br><br>            This disables cgo by default, since a cross-compiling C/C++ toolchain is             rarely available. To force cgo, set <code>pure</code> = <code>off</code>.<br><br>            See [Cross compilation] for more information.   | String | optional | "auto" |
-| <a id="go_test-gotags"></a>gotags |  Enables a list of build tags when evaluating [build constraints]. Useful for             conditional compilation.   | List of strings | optional | [] |
-| <a id="go_test-importpath"></a>importpath |  The import path of this test. Tests can't actually be imported, but this             may be used by [go_path] and other tools to report the location of source             files. This may be inferred from embedded libraries.   | String | optional | "" |
-| <a id="go_test-linkmode"></a>linkmode |  Determines how the binary should be built and linked. This accepts some of             the same values as `go build -buildmode` and works the same way.             <br><br>             <ul>             <li>`auto` (default): Controlled by `//go/config:linkmode`, which defaults to `pie` on supported platforms and `normal` elsewhere.</li>             <li>`normal`: Builds a normal executable with position-dependent code.</li>             <li>`pie`: Builds a position-independent executable.</li>             <li>`plugin`: Builds a shared library that can be loaded as a Go plugin. Only supported on platforms that support plugins.</li>             <li>`c-shared`: Builds a shared library that can be linked into a C program.</li>             <li>`c-archive`: Builds an archive that can be linked into a C program.</li>             </ul>   | String | optional | "auto" |
-| <a id="go_test-msan"></a>msan |  Controls whether code is instrumented for memory sanitization. May be one of             <code>on</code>, <code>off</code>, or <code>auto</code>. Not available when cgo is             disabled. In most cases, it's better to control this on the command line with             <code>--@io_bazel_rules_go//go/config:msan</code>. See [mode attributes], specifically             [msan].   | String | optional | "auto" |
-| <a id="go_test-pure"></a>pure |  Controls whether cgo source code and dependencies are compiled and linked,             similar to setting <code>CGO_ENABLED</code>. May be one of <code>on</code>, <code>off</code>,             or <code>auto</code>. If <code>auto</code>, pure mode is enabled when no C/C++             toolchain is configured or when cross-compiling. It's usually better to             control this on the command line with             <code>--@io_bazel_rules_go//go/config:pure</code>. See [mode attributes], specifically             [pure].   | String | optional | "auto" |
-| <a id="go_test-race"></a>race |  Controls whether code is instrumented for race detection. May be one of             <code>on</code>, <code>off</code>, or <code>auto</code>. Not available when cgo is             disabled. In most cases, it's better to control this on the command line with             <code>--@io_bazel_rules_go//go/config:race</code>. See [mode attributes], specifically             [race].   | String | optional | "auto" |
-| <a id="go_test-rundir"></a>rundir |  A directory to cd to before the test is run.             This should be a path relative to the root directory of the             repository in which the test is defined, which can be the main or an             external repository.<br><br>            The default behaviour is to change to the relative path             corresponding to the test's package, which replicates the normal             behaviour of <code>go test</code> so it is easy to write compatible tests.<br><br>            Setting it to <code>.</code> makes the test behave the normal way for a bazel             test, except that the working directory is always that of the test's             repository, which is not necessarily the main repository.<br><br>            Note: If runfile symlinks are disabled (such as on Windows by             default), the test will run in the working directory set by Bazel,             which is the subdirectory of the runfiles directory corresponding to             the main repository.   | String | optional | "" |
-| <a id="go_test-srcs"></a>srcs |  The list of Go source files that are compiled to create the package.             Only <code>.go</code>, <code>.s</code>, and <code>.syso</code> files are permitted, unless the <code>cgo</code>             attribute is set, in which case,             <code>.c .cc .cpp .cxx .h .hh .hpp .hxx .inc .m .mm</code>             files are also permitted. Files may be filtered at build time             using Go [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | [] |
-| <a id="go_test-static"></a>static |  Controls whether a binary is statically linked. May be one of <code>on</code>,             <code>off</code>, or <code>auto</code>. Not available on all platforms or in all             modes. It's usually better to control this on the command line with             <code>--@io_bazel_rules_go//go/config:static</code>. See [mode attributes],             specifically [static].   | String | optional | "auto" |
-| <a id="go_test-x_defs"></a>x_defs |  Map of defines to add to the go link command.             See [Defines and stamping] for examples of how to use these.   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional | {} |
+| <a id="go_test-deps"></a>deps |  List of Go libraries this test imports directly. These may be go_library rules or compatible rules with the [GoInfo] provider.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_test-srcs"></a>srcs |  The list of Go source files that are compiled to create the package. Only `.go`, `.s`, and `.syso` files are permitted, unless the `cgo` attribute is set, in which case, `.c .cc .cpp .cxx .h .hh .hpp .hxx .inc .m .mm` files are also permitted. Files may be filtered at build time using Go [build constraints].   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_test-data"></a>data |  List of files needed by this rule at run-time. This may include data files needed or other programs that may be executed. The [bazel] package may be used to locate run files; they may appear in different places depending on the operating system and environment. See [data dependencies] for more information on data files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_test-cdeps"></a>cdeps |  The list of other libraries that the c code depends on. This can be anything that would be allowed in [cc_library deps] Only valid if `cgo` = `True`.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_test-cgo"></a>cgo |  If `True`, the package may contain [cgo] code, and `srcs` may contain C, C++, Objective-C, and Objective-C++ files and non-Go assembly files. When cgo is enabled, these files will be compiled with the C/C++ toolchain and included in the package. Note that this attribute does not force cgo to be enabled. Cgo is enabled for non-cross-compiling builds when a C/C++ toolchain is configured.   | Boolean | optional |  `False`  |
+| <a id="go_test-clinkopts"></a>clinkopts |  List of flags to add to the C link command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_test-copts"></a>copts |  List of flags to add to the C compilation command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_test-cppopts"></a>cppopts |  List of flags to add to the C/C++ preprocessor command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_test-cxxopts"></a>cxxopts |  List of flags to add to the C++ compilation command. Subject to ["Make variable"] substitution and [Bourne shell tokenization]. Only valid if `cgo` = `True`.   | List of strings | optional |  `[]`  |
+| <a id="go_test-embed"></a>embed |  List of Go libraries whose sources should be compiled together with this package's sources. Labels listed here must name `go_library`, `go_proto_library`, or other compatible targets with the [GoInfo] provider. Embedded libraries must have the same `importpath` as the embedding library. At most one embedded library may have `cgo = True`, and the embedding library may not also have `cgo = True`. See [Embedding] for more information.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_test-embedsrcs"></a>embedsrcs |  The list of files that may be embedded into the compiled package using `//go:embed` directives. All files must be in the same logical directory or a subdirectory as source files. All source files containing `//go:embed` directives must be in the same logical directory. It's okay to mix static and generated source files and static and generated embeddable files.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional |  `[]`  |
+| <a id="go_test-env"></a>env |  Environment variables to set for the test execution. The values (but not keys) are subject to [location expansion](https://docs.bazel.build/versions/main/skylark/macros.html) but not full [make variable expansion](https://docs.bazel.build/versions/main/be/make-variables.html).   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional |  `{}`  |
+| <a id="go_test-env_inherit"></a>env_inherit |  Environment variables to inherit from the external environment.   | List of strings | optional |  `[]`  |
+| <a id="go_test-gc_goopts"></a>gc_goopts |  List of flags to add to the Go compilation command when using the gc compiler. Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional |  `[]`  |
+| <a id="go_test-gc_linkopts"></a>gc_linkopts |  List of flags to add to the Go link command when using the gc compiler. Subject to ["Make variable"] substitution and [Bourne shell tokenization].   | List of strings | optional |  `[]`  |
+| <a id="go_test-goarch"></a>goarch |  Forces a binary to be cross-compiled for a specific architecture. It's usually better to control this on the command line with `--platforms`.<br><br>This disables cgo by default, since a cross-compiling C/C++ toolchain is rarely available. To force cgo, set `pure` = `off`.<br><br>See [Cross compilation] for more information.   | String | optional |  `"auto"`  |
+| <a id="go_test-goos"></a>goos |  Forces a binary to be cross-compiled for a specific operating system. It's usually better to control this on the command line with `--platforms`.<br><br>This disables cgo by default, since a cross-compiling C/C++ toolchain is rarely available. To force cgo, set `pure` = `off`.<br><br>See [Cross compilation] for more information.   | String | optional |  `"auto"`  |
+| <a id="go_test-gotags"></a>gotags |  Enables a list of build tags when evaluating [build constraints]. Useful for conditional compilation.   | List of strings | optional |  `[]`  |
+| <a id="go_test-importpath"></a>importpath |  The import path of this test. Tests can't actually be imported, but this may be used by [go_path] and other tools to report the location of source files. This may be inferred from embedded libraries.   | String | optional |  `""`  |
+| <a id="go_test-linkmode"></a>linkmode |  Determines how the binary should be built and linked. This accepts some of the same values as `go build -buildmode` and works the same way. <br><br> <ul> <li>`auto` (default): Controlled by `//go/config:linkmode`, which defaults to `pie` on supported platforms and `normal` elsewhere.</li> <li>`normal`: Builds a normal executable with position-dependent code.</li> <li>`pie`: Builds a position-independent executable.</li> <li>`plugin`: Builds a shared library that can be loaded as a Go plugin. Only supported on platforms that support plugins.</li> <li>`c-shared`: Builds a shared library that can be linked into a C program.</li> <li>`c-archive`: Builds an archive that can be linked into a C program.</li> </ul>   | String | optional |  `"auto"`  |
+| <a id="go_test-msan"></a>msan |  Controls whether code is instrumented for memory sanitization. May be one of `on`, `off`, or `auto`. Not available when cgo is disabled. In most cases, it's better to control this on the command line with `--@io_bazel_rules_go//go/config:msan`. See [mode attributes], specifically [msan].   | String | optional |  `"auto"`  |
+| <a id="go_test-pure"></a>pure |  Controls whether cgo source code and dependencies are compiled and linked, similar to setting `CGO_ENABLED`. May be one of `on`, `off`, or `auto`. If `auto`, pure mode is enabled when no C/C++ toolchain is configured or when cross-compiling. It's usually better to control this on the command line with `--@io_bazel_rules_go//go/config:pure`. See [mode attributes], specifically [pure].   | String | optional |  `"auto"`  |
+| <a id="go_test-race"></a>race |  Controls whether code is instrumented for race detection. May be one of `on`, `off`, or `auto`. Not available when cgo is disabled. In most cases, it's better to control this on the command line with `--@io_bazel_rules_go//go/config:race`. See [mode attributes], specifically [race].   | String | optional |  `"auto"`  |
+| <a id="go_test-rundir"></a>rundir |  A directory to cd to before the test is run. This should be a path relative to the root directory of the repository in which the test is defined, which can be the main or an external repository.<br><br>The default behaviour is to change to the relative path corresponding to the test's package, which replicates the normal behaviour of `go test` so it is easy to write compatible tests.<br><br>Setting it to `.` makes the test behave the normal way for a bazel test, except that the working directory is always that of the test's repository, which is not necessarily the main repository.<br><br>Note: If runfile symlinks are disabled (such as on Windows by default), the test will run in the working directory set by Bazel, which is the subdirectory of the runfiles directory corresponding to the main repository.   | String | optional |  `""`  |
+| <a id="go_test-static"></a>static |  Controls whether a binary is statically linked. May be one of `on`, `off`, or `auto`. Not available on all platforms or in all modes. It's usually better to control this on the command line with `--@io_bazel_rules_go//go/config:static`. See [mode attributes], specifically [static].   | String | optional |  `"auto"`  |
+| <a id="go_test-x_defs"></a>x_defs |  Map of defines to add to the go link command. See [Defines and stamping] for examples of how to use these.   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional |  `{}`  |
 
 
diff --git a/docs/go/extras/extras.md b/docs/go/extras/extras.md
index 1c3a200..773802c 100644
--- a/docs/go/extras/extras.md
+++ b/docs/go/extras/extras.md
@@ -1,6 +1,5 @@
 <!-- Generated with Stardoc: http://skydoc.bazel.build -->
 
-
   [gazelle rule]: https://github.com/bazelbuild/bazel-gazelle#bazel-rule
   [golang/mock]: https://github.com/golang/mock
   [core go rules]: /docs/go/core/rules.md
@@ -26,13 +25,13 @@
 
 This rule has moved. See [gazelle rule] in the Gazelle repository.
 
-
-
 <a id="gomock"></a>
 
 ## gomock
 
 <pre>
+load("@rules_go//docs/go/extras:extras.bzl", "gomock")
+
 gomock(<a href="#gomock-name">name</a>, <a href="#gomock-out">out</a>, <a href="#gomock-library">library</a>, <a href="#gomock-source_importpath">source_importpath</a>, <a href="#gomock-source">source</a>, <a href="#gomock-interfaces">interfaces</a>, <a href="#gomock-package">package</a>, <a href="#gomock-self_package">self_package</a>, <a href="#gomock-aux_files">aux_files</a>,
        <a href="#gomock-mockgen_tool">mockgen_tool</a>, <a href="#gomock-mockgen_args">mockgen_args</a>, <a href="#gomock-imports">imports</a>, <a href="#gomock-copyright_file">copyright_file</a>, <a href="#gomock-mock_names">mock_names</a>, <a href="#gomock-kwargs">kwargs</a>)
 </pre>
@@ -49,18 +48,18 @@
 | :------------- | :------------- | :------------- |
 | <a id="gomock-name"></a>name |  the target name.   |  none |
 | <a id="gomock-out"></a>out |  the output Go file name.   |  none |
-| <a id="gomock-library"></a>library |  the Go library to look into for the interfaces (reflective mode) or source (source mode). If running in source mode, you can specify source_importpath instead of this parameter.   |  <code>None</code> |
-| <a id="gomock-source_importpath"></a>source_importpath |  the importpath for the source file. Alternative to passing library, which can lead to circular dependencies between mock and library targets. Only valid for source mode.   |  <code>""</code> |
-| <a id="gomock-source"></a>source |  a Go file in the given <code>library</code>. If this is given, <code>gomock</code> will call mockgen in source mode to mock all interfaces in the file.   |  <code>None</code> |
-| <a id="gomock-interfaces"></a>interfaces |  a list of interfaces in the given <code>library</code> to be mocked in reflective mode.   |  <code>[]</code> |
-| <a id="gomock-package"></a>package |  the name of the package the generated mocks should be in. If not specified, uses mockgen's default. See [mockgen's -package](https://github.com/golang/mock#flags) for more information.   |  <code>""</code> |
-| <a id="gomock-self_package"></a>self_package |  the full package import path for the generated code. The purpose of this flag is to prevent import cycles in the generated code by trying to include its own package. See [mockgen's -self_package](https://github.com/golang/mock#flags) for more information.   |  <code>""</code> |
-| <a id="gomock-aux_files"></a>aux_files |  a map from source files to their package path. This only needed when <code>source</code> is provided. See [mockgen's -aux_files](https://github.com/golang/mock#flags) for more information.   |  <code>{}</code> |
-| <a id="gomock-mockgen_tool"></a>mockgen_tool |  the mockgen tool to run.   |  <code>Label("//extras/gomock:mockgen")</code> |
-| <a id="gomock-mockgen_args"></a>mockgen_args |  additional arguments to pass to the mockgen tool.   |  <code>[]</code> |
-| <a id="gomock-imports"></a>imports |  dictionary of name-path pairs of explicit imports to use. See [mockgen's -imports](https://github.com/golang/mock#flags) for more information.   |  <code>{}</code> |
-| <a id="gomock-copyright_file"></a>copyright_file |  optional file containing copyright to prepend to the generated contents. See [mockgen's -copyright_file](https://github.com/golang/mock#flags) for more information.   |  <code>None</code> |
-| <a id="gomock-mock_names"></a>mock_names |  dictionary of interface name to mock name pairs to change the output names of the mock objects. Mock names default to 'Mock' prepended to the name of the interface. See [mockgen's -mock_names](https://github.com/golang/mock#flags) for more information.   |  <code>{}</code> |
+| <a id="gomock-library"></a>library |  the Go library to look into for the interfaces (reflective mode) or source (source mode). If running in source mode, you can specify source_importpath instead of this parameter.   |  `None` |
+| <a id="gomock-source_importpath"></a>source_importpath |  the importpath for the source file. Alternative to passing library, which can lead to circular dependencies between mock and library targets. Only valid for source mode.   |  `""` |
+| <a id="gomock-source"></a>source |  a Go file in the given `library`. If this is given, `gomock` will call mockgen in source mode to mock all interfaces in the file.   |  `None` |
+| <a id="gomock-interfaces"></a>interfaces |  a list of interfaces in the given `library` to be mocked in reflective mode.   |  `[]` |
+| <a id="gomock-package"></a>package |  the name of the package the generated mocks should be in. If not specified, uses mockgen's default. See [mockgen's -package](https://github.com/golang/mock#flags) for more information.   |  `""` |
+| <a id="gomock-self_package"></a>self_package |  the full package import path for the generated code. The purpose of this flag is to prevent import cycles in the generated code by trying to include its own package. See [mockgen's -self_package](https://github.com/golang/mock#flags) for more information.   |  `""` |
+| <a id="gomock-aux_files"></a>aux_files |  a map from source files to their package path. This only needed when `source` is provided. See [mockgen's -aux_files](https://github.com/golang/mock#flags) for more information.   |  `{}` |
+| <a id="gomock-mockgen_tool"></a>mockgen_tool |  the mockgen tool to run.   |  `Label("@rules_go//extras/gomock:mockgen")` |
+| <a id="gomock-mockgen_args"></a>mockgen_args |  additional arguments to pass to the mockgen tool.   |  `[]` |
+| <a id="gomock-imports"></a>imports |  dictionary of name-path pairs of explicit imports to use. See [mockgen's -imports](https://github.com/golang/mock#flags) for more information.   |  `{}` |
+| <a id="gomock-copyright_file"></a>copyright_file |  optional file containing copyright to prepend to the generated contents. See [mockgen's -copyright_file](https://github.com/golang/mock#flags) for more information.   |  `None` |
+| <a id="gomock-mock_names"></a>mock_names |  dictionary of interface name to mock name pairs to change the output names of the mock objects. Mock names default to 'Mock' prepended to the name of the interface. See [mockgen's -mock_names](https://github.com/golang/mock#flags) for more information.   |  `{}` |
 | <a id="gomock-kwargs"></a>kwargs |  <p align="center"> - </p>   |  none |
 
 
diff --git a/docs/rule_body.vm b/docs/rule_body.vm
deleted file mode 100644
index 8a88920..0000000
--- a/docs/rule_body.vm
+++ /dev/null
@@ -1,37 +0,0 @@
-#**
-This template is used for including rule definitions as top-level sections in generated stardoc docstrings.
-*#
-#*
-Workaround for markdownCellFormat() not allowing HTML (specifically lists) to be rendered in attribute table cells.
-
-TODO: Once https://github.com/bazelbuild/bazel/pull/14230 is merged, remove this macro and replace with call to
-      util.markdownCellFormatWithHtml($attribute.docString, true)
-*#
-#macro( markdownCellFormatNoEscapeHtml $docString )#*
-  *##if ($docString.contains("<ul>"))#*
-      *#${docString.trim().replaceAll("\n(\\s*\n)+", "<br><br>").replaceAll("\n", " ")}#*
-  *##else#*
-      *#${util.markdownCellFormat($docString)}#*
-  *##end#*
-*##end
-
-<a id="#${ruleName}"></a>
-
-#[[##]]# ${ruleName}
-
-<pre>
-${util.ruleSummary($ruleName, $ruleInfo)}
-</pre>
-
-${ruleInfo.docString}
-
-#[[###]]# **Attributes**
-
-#if (!$ruleInfo.getAttributeList().isEmpty())
-
-| Name  | Description | Type | Mandatory | Default |
-| :------------- | :------------- | :------------- | :------------- | :------------- |
-#foreach ($attribute in $ruleInfo.getAttributeList())
-| <a id="${ruleName}-${attribute.name}"></a>$attribute.name | #if(!$attribute.docString.isEmpty()) #markdownCellFormatNoEscapeHtml( $attribute.docString ) #else - #end  | ${util.attributeTypeString($attribute)} | ${util.mandatoryString($attribute)} | $attribute.defaultValue |
-#end
-#end
diff --git a/go.mod b/go.mod
index d713145..f5c1efa 100644
--- a/go.mod
+++ b/go.mod
@@ -2,25 +2,27 @@
 
 toolchain go1.25.0
 
-go 1.22.0
+go 1.24.0
 
 require (
 	github.com/gogo/protobuf v1.3.2
 	github.com/golang/mock v1.7.0-rc.1
 	github.com/golang/protobuf v1.5.4
 	github.com/pmezard/go-difflib v1.0.0
-	golang.org/x/net v0.35.0
-	golang.org/x/tools v0.30.0
+	golang.org/x/crypto v0.39.0
+	golang.org/x/net v0.41.0
+	golang.org/x/tools v0.34.0
 	google.golang.org/genproto v0.0.0-20250115164207-1a7da9e5054f
-	google.golang.org/grpc v1.67.3
+	google.golang.org/genproto/googleapis/bytestream v0.0.0-20251124214823-79d6a2a48846
+	google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4
+	google.golang.org/grpc v1.71.0
 	google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1
-	google.golang.org/protobuf v1.36.3
+	google.golang.org/protobuf v1.36.10
 )
 
 require (
-	golang.org/x/mod v0.23.0 // indirect
-	golang.org/x/sync v0.11.0 // indirect
-	golang.org/x/sys v0.30.0 // indirect
-	golang.org/x/text v0.22.0 // indirect
-	google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect
+	golang.org/x/mod v0.25.0 // indirect
+	golang.org/x/sync v0.15.0 // indirect
+	golang.org/x/sys v0.33.0 // indirect
+	golang.org/x/text v0.26.0 // indirect
 )
diff --git a/go.sum b/go.sum
index b8e4724..60fd486 100644
--- a/go.sum
+++ b/go.sum
@@ -1,11 +1,17 @@
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
 github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
 github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=
 github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs=
 github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
 github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
+github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -13,60 +19,76 @@
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
+go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
+go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
+go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
+go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
+go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
+go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
+go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
+go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
+go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
+go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
+go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
+golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
 golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
-golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
-golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
+golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
+golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
-golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
+golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
+golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
-golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
+golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
-golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
+golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
-golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
+golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
+golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
-golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
-golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
+golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
+golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/genproto v0.0.0-20250115164207-1a7da9e5054f h1:387Y+JbxF52bmesc8kq1NyYIp33dnxCw6eiA7JMsTmw=
 google.golang.org/genproto v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:0joYwWwLQh18AOj8zMYeZLjzuqcYTU3/nC5JdCvC3JI=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4=
-google.golang.org/grpc v1.67.3 h1:OgPcDAFKHnH8X3O4WcO4XUc8GRDeKsKReqbQtiCj7N8=
-google.golang.org/grpc v1.67.3/go.mod h1:YGaHCc6Oap+FzBJTZLBzkGSYt/cvGPFTPxkn7QfSU8s=
+google.golang.org/genproto/googleapis/bytestream v0.0.0-20251124214823-79d6a2a48846 h1:7FlucM2tFADtEDnIlDrR12KdRqV48B1GSTU1U6uKSiY=
+google.golang.org/genproto/googleapis/bytestream v0.0.0-20251124214823-79d6a2a48846/go.mod h1:G3Q0qS3k/oFEmVMddPsSYcFnm2+Mq2XRmxujrtu5hr0=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I=
+google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
+google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A=
 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA=
-google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU=
-google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
+google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
+google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
diff --git a/go/private/extensions.bzl b/go/private/extensions.bzl
index da41f8b..5dccc87 100644
--- a/go/private/extensions.bzl
+++ b/go/private/extensions.bzl
@@ -191,7 +191,7 @@
         else:
             multi_version_module[module.name] = False
 
-    # We remember the first host compatible toolchain declared by the download and host tags.
+    # We remember the first host compatible toolchain declared by the download, host, and from_file tags.
     # The order follows bazel's iteration over modules (the toolchains declared by the root module are considered first).
     # We know that at least `go_default_sdk` (which is declared by the `rules_go` module itself) is host compatible.
     first_host_compatible_toolchain = None
@@ -271,7 +271,13 @@
             download_tag["version"] = version
             additional_download_tags.append(struct(**download_tag))
 
-        for index, download_tag in enumerate(module.tags.download + additional_download_tags):
+        # We handle the `additional_download_tags` first so that `from_file` takes precedence
+        # over extra SDKs specified with `download`. That way the `from_file` toolchains are registered
+        # with higher precedence and become default, while `download`'ed toolchains can still be
+        # requested explicitly.
+        # TODO(zbarsky/fmeum): This is still not the ideal ordering. We should respect the order that tags are
+        # specified in, but Bzlmod currently doesn't provide this information across tag classes.
+        for index, download_tag in enumerate(additional_download_tags + module.tags.download):
             # SDKs without an explicit version are fetched even when not selected by toolchain
             # resolution. This is acceptable if brought in by the root module, but transitive
             # dependencies should not slow down the build in this way.
diff --git a/go/tools/builders/stdliblist_test.go b/go/tools/builders/stdliblist_test.go
index 96259b9..5d5de82 100644
--- a/go/tools/builders/stdliblist_test.go
+++ b/go/tools/builders/stdliblist_test.go
@@ -33,8 +33,8 @@
 			t.Errorf("unable to decode output json: %v\n", err)
 		}
 
-		if !strings.HasPrefix(result.ID, "@//stdlib:") {
-			t.Errorf("ID should be prefixed with @//stdlib: :%v", result)
+		if !strings.HasPrefix(result.ID, "@@//stdlib:") {
+			t.Errorf("ID should be prefixed with @@//stdlib: :%v", result)
 		}
 		if result.ExportFile != "" {
 			t.Errorf("ExportsFile should be empty when disabled but got: %v", result)
@@ -75,8 +75,8 @@
 			t.Errorf("unable to decode output json: %v\n", err)
 		}
 
-		if !strings.HasPrefix(result.ID, "@//stdlib:") {
-			t.Errorf("ID should be prefixed with @//stdlib: :%v", result)
+		if !strings.HasPrefix(result.ID, "@@//stdlib:") {
+			t.Errorf("ID should be prefixed with @@//stdlib: :%v", result)
 		}
 		if result.ExportFile != "" {
 			anyExportSet = true
diff --git a/go/tools/gopackagesdriver/BUILD.bazel b/go/tools/gopackagesdriver/BUILD.bazel
index e58f582..5ee71d9 100644
--- a/go/tools/gopackagesdriver/BUILD.bazel
+++ b/go/tools/gopackagesdriver/BUILD.bazel
@@ -33,20 +33,12 @@
     },
 )
 
-RULES_GO_REPO_NAME_FOR_TEST = RULES_GO_REPO_NAME if RULES_GO_REPO_NAME != "@" else "@io_bazel_rules_go"
-
 go_bazel_test(
     name = "gopackagesdriver_test",
     size = "enormous",
     srcs = ["gopackagesdriver_test.go"],
     embed = [":gopackagesdriver_lib"],
-    env = {
-        "GOPACKAGESDRIVER_BAZEL_COMMON_FLAGS": "--noexperimental_enable_bzlmod",
-    },
     rule_files = ["//:all_files"],
-    x_defs = {
-        "rulesGoRepositoryName": RULES_GO_REPO_NAME_FOR_TEST,
-    },
 )
 
 filegroup(
diff --git a/go/tools/gopackagesdriver/main.go b/go/tools/gopackagesdriver/main.go
index dea1e57..9ca6302 100644
--- a/go/tools/gopackagesdriver/main.go
+++ b/go/tools/gopackagesdriver/main.go
@@ -52,9 +52,7 @@
 }
 
 var (
-	// Injected via x_defs.
-
-	rulesGoRepositoryName string
+	rulesGoRepositoryName = "@io_bazel_rules_go"
 	goDefaultAspect       = rulesGoRepositoryName + "//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect"
 	bazelBin              = getenvDefault("GOPACKAGESDRIVER_BAZEL", "bazel")
 	bazelStartupFlags     = strings.Fields(os.Getenv("GOPACKAGESDRIVER_BAZEL_FLAGS"))
diff --git a/tests/core/stdlib/BUILD.bazel b/tests/core/stdlib/BUILD.bazel
index eed9465..5359d9d 100644
--- a/tests/core/stdlib/BUILD.bazel
+++ b/tests/core/stdlib/BUILD.bazel
@@ -4,7 +4,10 @@
 go_test(
     name = "buildid_test",
     srcs = ["buildid_test.go"],
-    data = [":stdlib_files"],
+    data = [
+        "@go_sdk//:files",
+        ":stdlib_files",
+    ],
     deps = ["//go/runfiles"],
 )
 
diff --git a/tests/core/stdlib/buildid_test.go b/tests/core/stdlib/buildid_test.go
index d95ba90..6df2278 100644
--- a/tests/core/stdlib/buildid_test.go
+++ b/tests/core/stdlib/buildid_test.go
@@ -21,7 +21,7 @@
 import (
 	"bytes"
 	"errors"
-	"os"
+	"io/fs"
 	"os/exec"
 	"path/filepath"
 	"testing"
@@ -30,58 +30,60 @@
 )
 
 func TestEmptyBuildID(t *testing.T) {
-	// Locate the buildid tool and several archive files to check.
-	//   fmt.a - pure go
-	//   crypto/aes.a - contains assembly
-	//   runtime/cgo.a - contains cgo
-	// The path may vary depending on platform and architecture, so just
-	// do a search.
-	var buildidPath string
-	pkgPaths := map[string]string{
-		"fmt.a": "",
-		"aes.a": "",
-		"cgo.a": "",
-	}
-	stdlibPkgDir, err := runfiles.Rlocation("io_bazel_rules_go/stdlib_/pkg")
+	goPath, err := runfiles.Rlocation("go_sdk/bin/go")
 	if err != nil {
 		t.Fatal(err)
 	}
-	n := len(pkgPaths)
+
+	// Locate the buildid tool and several archive files to check.
+	//   fmt.a - pure go
+	//   crypto/aes.a - contains assembly
+	//   net.a - contains cgo
+	// The path may vary depending on platform and architecture, so just
+	// do a search.
+	pkgPaths := map[string]string{
+		"fmt.a": "",
+		"aes.a": "",
+		"net.a": "",
+	}
+	toFind := make(map[string]struct{})
+	for k := range pkgPaths {
+		toFind[k] = struct{}{}
+	}
+
+	stdlibPkgDir, err := runfiles.Rlocation("_main/stdlib_/pkg")
+	if err != nil {
+		t.Fatal(err)
+	}
+
 	done := errors.New("done")
-	var visit filepath.WalkFunc
-	visit = func(path string, info os.FileInfo, err error) error {
+	var visit fs.WalkDirFunc
+	visit = func(path string, d fs.DirEntry, err error) error {
 		if err != nil {
 			return err
 		}
-		if filepath.Base(path) == "buildid" && (info.Mode()&0111) != 0 {
-			buildidPath = path
-		}
-		for pkg := range pkgPaths {
-			if filepath.Base(path) == pkg {
-				pkgPaths[pkg] = path
-				n--
+		for pkg := range toFind {
+			if d.Name() == pkg {
+				pkgPaths[d.Name()] = path
+				delete(toFind, pkg)
 			}
 		}
-		if buildidPath != "" && n == 0 {
+		if len(toFind) == 0 {
 			return done
 		}
 		return nil
 	}
-	if err = filepath.Walk(stdlibPkgDir, visit); err != nil && err != done {
+	if err = filepath.WalkDir(stdlibPkgDir, visit); err != nil && err != done {
 		t.Fatal(err)
 	}
-	if buildidPath == "" {
-		t.Fatal("buildid not found")
-	}
 
 	for pkg, path := range pkgPaths {
 		if path == "" {
 			t.Errorf("could not locate %s", pkg)
 			continue
 		}
-		// Equivalent to: go tool buildid pkg.a
 		// It's an error if this produces any output.
-		cmd := exec.Command(buildidPath, path)
+		cmd := exec.Command(goPath, "tool", "buildid", path)
 		out, err := cmd.Output()
 		if err != nil {
 			t.Error(err)
diff --git a/tests/examples/executable_name/name_test.sh b/tests/examples/executable_name/name_test.sh
index 9aedc0f..5345658 100755
--- a/tests/examples/executable_name/name_test.sh
+++ b/tests/examples/executable_name/name_test.sh
@@ -1,4 +1,4 @@
-result="$(${TEST_SRCDIR}/io_bazel_rules_go/tests/examples/executable_name/the_binary)"
+result="$(${TEST_SRCDIR}/_main/tests/examples/executable_name/the_binary)"
 expect="The executable ran!"
 if [ "$result" != "$expect" ]; then
   echo "error: unexpected bazel exit code: want '$expect', got '$result'" >&2
diff --git a/tests/extras/gomock/reflective/BUILD.bazel b/tests/extras/gomock/reflective/BUILD.bazel
index 4ea81e1..d27a61a 100644
--- a/tests/extras/gomock/reflective/BUILD.bazel
+++ b/tests/extras/gomock/reflective/BUILD.bazel
@@ -8,7 +8,7 @@
     importpath = "github.com/bazelbuild/rules_go/gomock/client",
     visibility = ["//visibility:public"],
     deps = [
-        "@org_golang_google_genproto//googleapis/bytestream",
+        "@org_golang_google_genproto_googleapis_bytestream//:bytestream",
         "@org_golang_google_grpc//:grpc",
     ],
 )
diff --git a/tests/extras/gomock/source/BUILD.bazel b/tests/extras/gomock/source/BUILD.bazel
index 4e5e45d..721ecd0 100644
--- a/tests/extras/gomock/source/BUILD.bazel
+++ b/tests/extras/gomock/source/BUILD.bazel
@@ -9,7 +9,7 @@
     importpath = "github.com/bazelbuild/rules_go/gomock/client",
     visibility = ["//visibility:public"],
     deps = [
-        "@org_golang_google_genproto//googleapis/bytestream",
+        "@org_golang_google_genproto_googleapis_bytestream//:bytestream",
         "@org_golang_google_grpc//:grpc",
     ],
 )
diff --git a/tests/extras/gomock/source_with_importpath/BUILD.bazel b/tests/extras/gomock/source_with_importpath/BUILD.bazel
index efaeeb3..6a62235 100644
--- a/tests/extras/gomock/source_with_importpath/BUILD.bazel
+++ b/tests/extras/gomock/source_with_importpath/BUILD.bazel
@@ -11,7 +11,7 @@
     visibility = ["//visibility:public"],
     deps = [
         "@com_github_golang_mock//gomock",
-        "@org_golang_google_genproto//googleapis/bytestream",
+        "@org_golang_google_genproto_googleapis_bytestream//:bytestream",
         "@org_golang_google_grpc//:grpc",
     ],
 )
diff --git a/tests/integration/googleapis/BUILD.bazel b/tests/integration/googleapis/BUILD.bazel
index ca93e11..89cf437 100644
--- a/tests/integration/googleapis/BUILD.bazel
+++ b/tests/integration/googleapis/BUILD.bazel
@@ -17,7 +17,7 @@
     importpath = "github.com/bazelbuild/rules_go/tests/integration/googleapis/color_service_proto",
     proto = ":color_service_proto",
     deps = [
-        "@org_golang_google_genproto//googleapis/rpc/status",
+        "@org_golang_google_genproto_googleapis_rpc//status",
         "@org_golang_google_genproto//googleapis/type/color",
     ],
 )
@@ -28,9 +28,9 @@
     importpath = "github.com/bazelbuild/rules_go/tests/integration/googleapis/color_service",
     deps = [
         ":color_service_go_proto",
-        "@org_golang_google_genproto//googleapis/rpc/code",
-        "@org_golang_google_genproto//googleapis/rpc/status",
         "@org_golang_google_genproto//googleapis/type/color",
+        "@org_golang_google_genproto_googleapis_rpc//code",
+        "@org_golang_google_genproto_googleapis_rpc//status",
     ],
 )
 
diff --git a/tests/integration/popular_repos/BUILD.bazel b/tests/integration/popular_repos/BUILD.bazel
index df26b91..51052ae 100644
--- a/tests/integration/popular_repos/BUILD.bazel
+++ b/tests/integration/popular_repos/BUILD.bazel
@@ -71,7 +71,6 @@
 test_suite(
     name = "org_golang_x_net",
     tests = [
-        "@org_golang_x_net//context:context_test",
         "@org_golang_x_net//context/ctxhttp:ctxhttp_test",
         "@org_golang_x_net//dns/dnsmessage:dnsmessage_test",
         "@org_golang_x_net//html:html_test",
@@ -188,8 +187,6 @@
         "@org_golang_x_tools//internal/edit:edit_test",
         "@org_golang_x_tools//internal/event:event_test",
         "@org_golang_x_tools//internal/event/export:export_test",
-        "@org_golang_x_tools//internal/event/export/ocagent:ocagent_test",
-        "@org_golang_x_tools//internal/event/export/ocagent/wire:wire_test",
         "@org_golang_x_tools//internal/event/keys:keys_test",
         "@org_golang_x_tools//internal/event/label:label_test",
         "@org_golang_x_tools//internal/gopathwalk:gopathwalk_test",
diff --git a/tests/integration/popular_repos/README.rst b/tests/integration/popular_repos/README.rst
index 43fd789..24c1c9c 100644
--- a/tests/integration/popular_repos/README.rst
+++ b/tests/integration/popular_repos/README.rst
@@ -64,7 +64,6 @@
 
 This runs tests from the repository `golang.org/x/net <https://golang.org/x/net>`_
 
-* @org_golang_x_net//context:context_test
 * @org_golang_x_net//context/ctxhttp:ctxhttp_test
 * @org_golang_x_net//dns/dnsmessage:dnsmessage_test
 * @org_golang_x_net//html:html_test
diff --git a/tools.go b/tools.go
index db12772..fa8dceb 100644
--- a/tools.go
+++ b/tools.go
@@ -10,7 +10,11 @@
 	_ "github.com/golang/mock/mockgen"
 	_ "github.com/golang/protobuf/protoc-gen-go"
 	_ "golang.org/x/net/context"
+	_ "golang.org/x/crypto/cryptobyte"
 	_ "google.golang.org/genproto/protobuf/api"
+	_ "google.golang.org/genproto/googleapis/bytestream"
+	_ "google.golang.org/genproto/googleapis/rpc/code"
+	_ "google.golang.org/genproto/googleapis/type/color"
 	_ "google.golang.org/grpc"
 	_ "google.golang.org/protobuf/cmd/protoc-gen-go"
 	_ "google.golang.org/grpc/cmd/protoc-gen-go-grpc"