diff options
| author | Jay Conrod <jayconrod@google.com> | 2020-04-15 14:17:08 -0400 |
|---|---|---|
| committer | Jay Conrod <jayconrod@google.com> | 2020-08-26 21:12:55 +0000 |
| commit | 0bbd386e8bbdf419077d708d3671245fc0f50f0c (patch) | |
| tree | c79d8378b3212cc4b34d823225a922338a892a63 /src/cmd/go/alldocs.go | |
| parent | c769f034d796769ad10fc03fe6866b36039d1a09 (diff) | |
| download | go-git-0bbd386e8bbdf419077d708d3671245fc0f50f0c.tar.gz | |
cmd/go: add -retract and -dropretract flags to 'go mod edit'
'go mod edit' can now add and remove 'retract' directives from go.mod
files.
Also, retractions are now included in the 'go mod edit -json' output.
For #24031
Change-Id: Ife7915e259fa508626d6ec5f786b5c860b489599
Reviewed-on: https://go-review.googlesource.com/c/go/+/228381
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/alldocs.go')
| -rw-r--r-- | src/cmd/go/alldocs.go | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index f50529c4f2..609ede49cd 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1100,9 +1100,14 @@ // module path and version pair. If the @v is omitted, a replacement without // a version on the left side is dropped. // +// The -retract=version and -dropretract=version flags add and drop a +// retraction on the given version. The version may be a single version +// like "v1.2.3" or a closed interval like "[v1.1.0-v1.1.9]". Note that +// -retract=version is a no-op if that retraction already exists. +// // The -require, -droprequire, -exclude, -dropexclude, -replace, -// and -dropreplace editing flags may be repeated, and the changes -// are applied in the order given. +// -dropreplace, -retract, and -dropretract editing flags may be repeated, +// and the changes are applied in the order given. // // The -go=version flag sets the expected Go language version. // @@ -1136,6 +1141,15 @@ // New Module // } // +// type Retract struct { +// Low string +// High string +// Rationale string +// } +// +// Retract entries representing a single version (not an interval) will have +// the "Low" and "High" fields set to the same value. +// // Note that this only describes the go.mod file itself, not other modules // referred to indirectly. For the full set of modules available to a build, // use 'go list -m -json all'. |
