[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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Cherry Mui 2025-11-24 12:03:59 -05:00
parent 220d73cc44
commit f045ed4110
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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)
}