Skip to content

Commit

Permalink
cmd/go: fix 'go help mod edit' JSON documentation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jay Conrod committed Apr 13, 2021
1 parent 49e933f commit d948b86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/cmd/go/alldocs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/cmd/go/internal/modcmd/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,24 @@ 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
Deprecated string
Path string
Version string
}
type GoMod struct {
Module Module
Module ModPath
Go string
Require []Require
Exclude []Module
Replace []Replace
Retract []Retract
}
type ModPath struct {
Path string
Deprecated string
}
type Require struct {
Path string
Version string
Expand Down

0 comments on commit d948b86

Please sign in to comment.