Background: These packages, designed for use in tests in x/tools, were published without proper deliberation, so any changes to their public APIs must go through the proposal process. There are dozens of improvements we (in x/tools) would like to have made that are simply too costly as a result. However, these packages are almost never used outside x/tools. Of the couple dozen imports reported by pkg.go.dev, nearly all are in repos that are forks of x/tools. The only real one is is k8s.io.

Proposal: We propose to fork these packages to an internal subtree, and then to tag and delete the public packages using the same process as https://github.com/golang/go/issues/59676.

Comment From: gopherbot

Change https://go.dev/cl/625919 mentions this issue: x/tools: use internal/expect instead of go/expect

Comment From: gopherbot

Change https://go.dev/cl/625918 mentions this issue: internal/expect: fork go/expect

Comment From: gopherbot

Change https://go.dev/cl/625920 mentions this issue: internal/packagestest: fork go/packages/packagestest

Comment From: gopherbot

Change https://go.dev/cl/625921 mentions this issue: go/{expect,packages/packagestest}: mention the tag+delete proposal

Comment From: findleyr

This seems like an easy decision to me. Essentially nobody is using these packages, and yet they have a large and restrictive API surface area, which is tightly coupled to our tests. Moving these to internal will reduce friction at essentially no cost.

I'd argue that if folks want to use these packages, they are better off forking in any case, for the same reasons.

Comment From: rsc

This proposal has been added to the active column of the proposals project and will now be reviewed at the weekly proposal review meetings. — rsc for the proposal review group

Comment From: aclements

Based on the discussion above, this proposal seems like a likely accept.

The proposal is to fork the golang.org/x/tools/go/packages/packagestest and golang.org/x/tools/go/expect packages to an internal subtree, and then to tag and delete the public packages using the same process as #59676.

Comment From: aclements

No change in consensus, so accepted. 🎉 This issue now tracks the work of implementing the proposal.

The proposal is to fork the golang.org/x/tools/go/packages/packagestest and golang.org/x/tools/go/expect packages to an internal subtree, and then to tag and delete the public packages using the same process as #59676.

Comment From: gopherbot

Change https://go.dev/cl/667296 mentions this issue: go/analysis/internal/checker: import internal 'expect' package

Comment From: gopherbot

Change https://go.dev/cl/680755 mentions this issue: go/{expect,packages/packagestest}: carve out submodules