]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.simd] go/doc/comment: don't include experimental packages in std list
authorCherry Mui <cherryyz@google.com>
Mon, 24 Nov 2025 17:03:59 +0000 (12:03 -0500)
committerCherry Mui <cherryyz@google.com>
Mon, 24 Nov 2025 18:08:53 +0000 (10:08 -0800)
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>
src/go/doc/comment/mkstd.sh
src/go/doc/comment/std_test.go

index c9dee8c55e69b1dfe102a07f3179b1d81ca1ebb6..9e383b942d31a57cd679c97db90d7a175fd5b527 100755 (executable)
@@ -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
index bd0379856a4d8cde3f92ca2dbde9f117da62a0bd..9077af070b1b89bc451c82eb68b79976a2589fe9 100644 (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)
        }