From f045ed4110aa430da0ba118d2be46f0d602d6633 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Mon, 24 Nov 2025 12:03:59 -0500 Subject: [PATCH] [dev.simd] go/doc/comment: don't include experimental packages in std list go/doc/comment/std.go has a list of top-level package prefixes in the standard library. This list can vary depending on goexperiment, but the file is static. E.g. GOEXPERIMENT=arenas go test -run=TestStd go/doc/comment would fail. Don't include experimental packages, as they are not (yet) generally available. We could have a per-experiment list of package prefixes. But given that experimental packages are not intended to be used widely (yet), it is probably not worth the complexity. Change-Id: Ib5bc060297cbae29c01fee458aaaa29600b81e98 Reviewed-on: https://go-review.googlesource.com/c/go/+/723840 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase --- src/go/doc/comment/mkstd.sh | 2 +- src/go/doc/comment/std_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/go/doc/comment/mkstd.sh b/src/go/doc/comment/mkstd.sh index c9dee8c55e..9e383b942d 100755 --- a/src/go/doc/comment/mkstd.sh +++ b/src/go/doc/comment/mkstd.sh @@ -19,6 +19,6 @@ echo "// Copyright 2022 The Go Authors. All rights reserved. package comment var stdPkgs = []string{" -go list std | grep -v / | sort | sed 's/.*/"&",/' +GOEXPERIMENT=none go list std | grep -v / | sort | sed 's/.*/"&",/' echo "}" ) | gofmt >std.go.tmp && mv std.go.tmp std.go diff --git a/src/go/doc/comment/std_test.go b/src/go/doc/comment/std_test.go index bd0379856a..9077af070b 100644 --- a/src/go/doc/comment/std_test.go +++ b/src/go/doc/comment/std_test.go @@ -13,7 +13,9 @@ import ( ) func TestStd(t *testing.T) { - out, err := testenv.Command(t, testenv.GoToolPath(t), "list", "std").CombinedOutput() + cmd := testenv.Command(t, testenv.GoToolPath(t), "list", "std") + cmd.Env = append(cmd.Environ(), "GOEXPERIMENT=none") + out, err := cmd.CombinedOutput() if err != nil { t.Fatalf("%v\n%s", err, out) } -- 2.52.0