Separate compiler export data from the format used by tools
Export data is the compact binary form of a package's type information. Today the compiler writes its own "unified" format, while x/tools (including gopls) uses an "indexed" format. Because go list -export runs the compiler, x/tools must also read the compiler's format. This couples the two and makes it hard for the compiler to change its format.
The proposal fully separates the two formats. The compiler will read and write only its own format, and only for the same toolchain version. That format becomes an internal detail with no supported reader, so it can change at any time. The Export field from go list -export will instead point to a file in the tools format. A new tool, cmd/export, will produce these files. It is built on go/ast, go/types, and vendored x/tools, and it type-checks a package and writes its export data.
Tools that run the compiler directly and read its export data must switch to go list -export or run cmd/export. x/tools will keep reading older compiler output for two more releases, following its usual support window.
- Proposal
- #79427 by adonovan
- Status
- Accepted on Oct 7, 2026
- Impact
- low