Sign in

Radar · Go · Archive · Week 10 · Mar 2 – 8, 2026

x/tools/go/analysis: add GoMod, … fields to Module

Nice to knowtooling

What changed
The analysis Module type now exposes all fields common to golang.org/x/tools/go/packages.Module and cmd/go/internal/modinfo.ModulePublic, including Path, Version, Replace, Time, Main, Indirect, Dir, GoMod, GoVersion, and Error.
Production impact
The source does not say.
Try it
Use the updated analysis API in a custom linter to inspect the GoMod field of modules.
Source
github.com/golang/go/issues/73878

Understand it, then run it

The analysis.Module type is a small struct that describes a Go module. Until now it only had a few fields, like the module path and version. A new change adds several more fields that are already present in the packages.Module type: GoMod, GoVersion, Dir, Main, Indirect, Replace, Time, and Error. These fields let you know where the module’s go.mod file lives, what Go version it uses, and other metadata that can help tools understand a project’s dependencies.

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