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 22 · May 26 – Jun 1, 2025

go/ast: deprecate FilterPackage, PackageExports, MergePackageFiles

Breakingstdlib

What changed
All functions that operate on the deprecated ast.Package type (FilterPackage, PackageExports, MergePackageFiles) and the related MergeMode type are now deprecated.
Production impact
The source does not say.
Try it
Refactor any AST‑processing code that relies on ast.Package to use the newer *ast.File‑based helpers instead.
Source
github.com/golang/go/issues/73088

Understand it, then run it

The Go standard library has a package called go/ast that represents Go source code as a tree of nodes. In older versions of the library, a type named ast.Package was used to hold a whole Go package, and several helper functions – FilterPackage, PackageExports, and MergePackageFiles – operated on that type. Those functions are now marked as deprecated, meaning they are still available but are discouraged from use because the type they rely on, ast.Package, is itself deprecated. The change does not add new features; it simply signals that developers should use newer alternatives that work with individual ast.File objects instead.

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