The types were added to the docs, but not the fields in GoMod.
While here, I was initially confused about what is the top-level type
given that `type Module` comes first. Move `type GoMod` to the top
as it is the actual top-level type.
Change-Id: I1270154837501f5c7f5b21959b2841fd4ac808d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/700116
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
// The -json flag prints the final go.mod file in JSON format instead of
// writing it back to go.mod. The JSON output corresponds to these Go types:
//
-// type Module struct {
-// Path string
-// Version string
-// }
-//
// type GoMod struct {
// Module ModPath
// Go string
// Exclude []Module
// Replace []Replace
// Retract []Retract
+// Tool []Tool
+// Ignore []Ignore
+// }
+//
+// type Module struct {
+// Path string
+// Version string
// }
//
// type ModPath struct {
The -json flag prints the final go.mod file in JSON format instead of
writing it back to go.mod. The JSON output corresponds to these Go types:
- type Module struct {
- Path string
- Version string
- }
-
type GoMod struct {
Module ModPath
Go string
Exclude []Module
Replace []Replace
Retract []Retract
+ Tool []Tool
+ Ignore []Ignore
+ }
+
+ type Module struct {
+ Path string
+ Version string
}
type ModPath struct {