@@ -1727,19 +1727,20 @@ to a Go struct, but now a `Module` struct:
1727
1727
1728
1728
```
1729
1729
type Module struct {
1730
- Path string // module path
1731
- Version string // module version
1732
- Versions []string // available module versions (with -versions)
1733
- Replace *Module // replaced by this module
1734
- Time *time.Time // time version was created
1735
- Update *Module // available update, if any (with -u)
1736
- Main bool // is this the main module?
1737
- Indirect bool // is this module only an indirect dependency of main module?
1738
- Dir string // directory holding files for this module, if any
1739
- GoMod string // path to go.mod file for this module, if any
1740
- GoVersion string // go version used in module
1741
- Deprecated string // deprecation message, if any (with -u)
1742
- Error *ModuleError // error loading module
1730
+ Path string // module path
1731
+ Version string // module version
1732
+ Versions []string // available module versions
1733
+ Replace *Module // replaced by this module
1734
+ Time *time.Time // time version was created
1735
+ Update *Module // available update (with -u)
1736
+ Main bool // is this the main module?
1737
+ Indirect bool // module is only indirectly needed by main module
1738
+ Dir string // directory holding local copy of files, if any
1739
+ GoMod string // path to go.mod file describing module, if any
1740
+ GoVersion string // go version used in module
1741
+ Retracted []string // retraction information, if any (with -retracted or -u)
1742
+ Deprecated string // deprecation message, if any (with -u)
1743
+ Error *ModuleError // error loading module
1743
1744
}
1744
1745
1745
1746
type ModuleError struct {
@@ -1841,6 +1842,7 @@ to this Go struct:
1841
1842
```
1842
1843
type Module struct {
1843
1844
Path string // module path
1845
+ Query string // version query corresponding to this version
1844
1846
Version string // module version
1845
1847
Error string // error loading module
1846
1848
Info string // absolute path to cached .info file
@@ -1849,6 +1851,8 @@ type Module struct {
1849
1851
Dir string // absolute path to cached source root directory
1850
1852
Sum string // checksum for path, version (as in go.sum)
1851
1853
GoModSum string // checksum for go.mod (as in go.sum)
1854
+ Origin any // provenance of module
1855
+ Reuse bool // reuse of old module info is safe
1852
1856
}
1853
1857
```
1854
1858
@@ -1947,11 +1951,17 @@ type Module struct {
1947
1951
}
1948
1952
1949
1953
type GoMod struct {
1950
- Module Module
1954
+ Module ModPath
1951
1955
Go string
1952
1956
Require []Require
1953
1957
Exclude []Module
1954
1958
Replace []Replace
1959
+ Retract []Retract
1960
+ }
1961
+
1962
+ type ModPath struct {
1963
+ Path string
1964
+ Deprecated string
1955
1965
}
1956
1966
1957
1967
type Require struct {
@@ -1970,7 +1980,6 @@ type Retract struct {
1970
1980
High string
1971
1981
Rationale string
1972
1982
}
1973
-
1974
1983
```
1975
1984
1976
1985
Note that this only describes the ` go.mod ` file itself, not other modules
0 commit comments