Skip to content

Commit

Permalink
cmd/go: test that the reserved paths "example" and "test" are not used
Browse files Browse the repository at this point in the history
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 <[email protected]>
Run-TryBot: Bryan C. Mills <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
  • Loading branch information
Bryan C. Mills committed Oct 29, 2021
1 parent 2c7cdec commit f288526
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cmd/go/testdata/script/list_reserved.txt
Original file line number Diff line number Diff line change
@@ -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 .

0 comments on commit f288526

Please sign in to comment.