See https://github.com/golang/go/blob/master/src/cmd/go/internal/list/list.go
type Module struct {
Path string // module path
Query string // version query corresponding to this version
Version string // module version
Versions []string // available module versions
Replace *Module // replaced by this module
Time *time.Time // time version was created
Update *Module // available update (with -u)
Main bool // is this the main module?
Indirect bool // module is only indirectly needed by main module
Dir string // directory holding local copy of files, if any
GoMod string // path to go.mod file describing module, if any
GoVersion string // go version used in module
Retracted []string // retraction information, if any (with -retracted or -u)
Deprecated string // deprecation message, if any (with -u)
Error *ModuleError // error loading module
Sum string // checksum for path, version (as in go.sum)
GoModSum string // checksum for go.mod (as in go.sum)
Origin any // provenance of module
Reuse bool // reuse of old module info is safe
}
type ModuleError struct {
Err string // the error itself
}
We have GoVersion string // go version used in module, which contains go X.Y.Z directive.
It would be nice to have something like GoToolchain string too which would contain toolchain goX.Y.Z directive.
See https://github.com/golang/go/blob/master/src/cmd/go/internal/list/list.go
We have
GoVersion string // go version used in module, which containsgo X.Y.Zdirective.It would be nice to have something like
GoToolchain stringtoo which would containtoolchain goX.Y.Zdirective.