mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/go: fix 'go help mod edit' JSON documentation
The object representing a module directive may have a "Deprecated" field but not a "Version" field. Other objects representing module versions have "Path" and "Version" fields but not "Deprecated". For #40357 Change-Id: Iad8063dfa6f7ceea22981a8a8f99e65fa3b7ffa0 Reviewed-on: https://go-review.googlesource.com/c/go/+/309337 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
49e933fc57
commit
d948b8633d
2 changed files with 16 additions and 6 deletions
|
|
@ -1134,12 +1134,12 @@
|
||||||
// writing it back to go.mod. The JSON output corresponds to these Go types:
|
// writing it back to go.mod. The JSON output corresponds to these Go types:
|
||||||
//
|
//
|
||||||
// type Module struct {
|
// type Module struct {
|
||||||
// Path string
|
// Path string
|
||||||
// Deprecated string
|
// Version string
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// type GoMod struct {
|
// type GoMod struct {
|
||||||
// Module Module
|
// Module ModPath
|
||||||
// Go string
|
// Go string
|
||||||
// Require []Require
|
// Require []Require
|
||||||
// Exclude []Module
|
// Exclude []Module
|
||||||
|
|
@ -1147,6 +1147,11 @@
|
||||||
// Retract []Retract
|
// Retract []Retract
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
// type ModPath struct {
|
||||||
|
// Path string
|
||||||
|
// Deprecated string
|
||||||
|
// }
|
||||||
|
//
|
||||||
// type Require struct {
|
// type Require struct {
|
||||||
// Path string
|
// Path string
|
||||||
// Version string
|
// Version string
|
||||||
|
|
|
||||||
|
|
@ -85,12 +85,12 @@ 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:
|
writing it back to go.mod. The JSON output corresponds to these Go types:
|
||||||
|
|
||||||
type Module struct {
|
type Module struct {
|
||||||
Path string
|
Path string
|
||||||
Deprecated string
|
Version string
|
||||||
}
|
}
|
||||||
|
|
||||||
type GoMod struct {
|
type GoMod struct {
|
||||||
Module Module
|
Module ModPath
|
||||||
Go string
|
Go string
|
||||||
Require []Require
|
Require []Require
|
||||||
Exclude []Module
|
Exclude []Module
|
||||||
|
|
@ -98,6 +98,11 @@ writing it back to go.mod. The JSON output corresponds to these Go types:
|
||||||
Retract []Retract
|
Retract []Retract
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ModPath struct {
|
||||||
|
Path string
|
||||||
|
Deprecated string
|
||||||
|
}
|
||||||
|
|
||||||
type Require struct {
|
type Require struct {
|
||||||
Path string
|
Path string
|
||||||
Version string
|
Version string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue