This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Go · Archive · Week 3 · Jan 13 – 19, 2025

x/tools/go/{packages/packagestest,expect}: deprecate, tag, and delete

Nice to knowtooling

What changed
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.
Production impact
The source does not say.
Try it
Search your codebase for imports of these packages and plan to remove them.
Source
github.com/golang/go/issues/70229

Understand it, then run it

The packages golang.org/x/tools/go/packages/packagestest and golang.org/x/tools/go/expect were originally meant only for tests inside the x/tools repository. They were published publicly without a formal review process, so any change to them had to go through a lengthy proposal. Because they are rarely used outside x/tools, the maintainers decided to move them into an internal location and then delete the public versions. This means that code that imports those packages will no longer compile once the deletion is complete.

Run it now

Todaygo
// This program demonstrates the deprecation of the public packages
// golang.org/x/tools/go/packages/packagestest and golang.org/x/tools/go/expect.
// Since the packages have been removed, attempting to import them would
// result in a compile error. The program simply prints a message.
package main

import "fmt"

func main() {
	fmt.Println("packagestest and expect have been deprecated and deleted.")
}

What it printed when we ran it on Go 1.27.1

packagestest and expect have been deprecated and deleted.

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed