From f2885263748364a2a7f4e0d47abd5095699cd39f Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 28 Oct 2021 22:25:02 -0400 Subject: [PATCH] cmd/go: test that the reserved paths "example" and "test" are not used Proposal #37641 reserved the paths "example" and "test" for end users, so no path beginning with either of those elements may be added to the standard library. (We are unlikely to add them by accident, but this test codifies the policy accepted in the proposal.) Fixes #37641 Change-Id: I999064180336c923d4918a1176c371b8f5666f8b Reviewed-on: https://go-review.googlesource.com/c/go/+/359576 Trust: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Go Bot Reviewed-by: Dmitri Shuralyov --- src/cmd/go/testdata/script/list_reserved.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/cmd/go/testdata/script/list_reserved.txt diff --git a/src/cmd/go/testdata/script/list_reserved.txt b/src/cmd/go/testdata/script/list_reserved.txt new file mode 100644 index 0000000000..b9c5361492 --- /dev/null +++ b/src/cmd/go/testdata/script/list_reserved.txt @@ -0,0 +1,7 @@ +# https://golang.org/issue/37641: the paths "example" and "test" are reserved +# for end users, and must never exist in the standard library. + +go list example/... test/... +stderr 'go: warning: "example/..." matched no packages$' +stderr 'go: warning: "test/..." matched no packages$' +! stdout . -- 2.50.0