diff options
author | Jay Conrod <jayconrod@google.com> | 2019-12-06 15:02:41 -0500 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2019-12-09 15:12:29 +0000 |
commit | f6774bc91b3037d8bcdec96c855320eb4932b4c2 (patch) | |
tree | c91edb94419d881d35ffc0c1aee603d7ccbff025 | |
parent | 1c8d1f45ba7b72836dfe93fc680dfb27ef174965 (diff) | |
download | go-f6774bc91b3037d8bcdec96c855320eb4932b4c2.tar.gz go-f6774bc91b3037d8bcdec96c855320eb4932b4c2.zip |
cmd/go: clarify -dropreplace help text in 'go help mod edit'
Fixes #34930
Change-Id: Ie0ddd8de6e40f5a192c4d2267399126e449fe5f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/210340
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
-rw-r--r-- | src/cmd/go/alldocs.go | 17 | ||||
-rw-r--r-- | src/cmd/go/internal/modcmd/edit.go | 17 |
2 files changed, 22 insertions, 12 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 013f7b3cfe..87c82b16de 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1075,12 +1075,17 @@ // add and drop an exclusion for the given module path and version. // Note that -exclude=path@version is a no-op if that exclusion already exists. // -// The -replace=old[@v]=new[@v] and -dropreplace=old[@v] flags -// add and drop a replacement of the given module path and version pair. -// If the @v in old@v is omitted, the replacement applies to all versions -// with the old module path. If the @v in new@v is omitted, the new path -// should be a local module root directory, not a module path. -// Note that -replace overrides any existing replacements for old[@v]. +// The -replace=old[@v]=new[@v] flag adds a replacement of the given +// module path and version pair. If the @v in old@v is omitted, a +// replacement without a version on the left side is added, which applies +// to all versions of the old module path. If the @v in new@v is omitted, +// the new path should be a local module root directory, not a module +// path. Note that -replace overrides any redundant replacements for old[@v], +// so omitting @v will drop existing replacements for specific versions. +// +// The -dropreplace=old[@v] flag drops a replacement of the given +// module path and version pair. If the @v is omitted, a replacement without +// a version on the left side is dropped. // // The -require, -droprequire, -exclude, -dropexclude, -replace, // and -dropreplace editing flags may be repeated, and the changes diff --git a/src/cmd/go/internal/modcmd/edit.go b/src/cmd/go/internal/modcmd/edit.go index 2cb4566796..dbbfb96e42 100644 --- a/src/cmd/go/internal/modcmd/edit.go +++ b/src/cmd/go/internal/modcmd/edit.go @@ -55,12 +55,17 @@ The -exclude=path@version and -dropexclude=path@version flags add and drop an exclusion for the given module path and version. Note that -exclude=path@version is a no-op if that exclusion already exists. -The -replace=old[@v]=new[@v] and -dropreplace=old[@v] flags -add and drop a replacement of the given module path and version pair. -If the @v in old@v is omitted, the replacement applies to all versions -with the old module path. If the @v in new@v is omitted, the new path -should be a local module root directory, not a module path. -Note that -replace overrides any existing replacements for old[@v]. +The -replace=old[@v]=new[@v] flag adds a replacement of the given +module path and version pair. If the @v in old@v is omitted, a +replacement without a version on the left side is added, which applies +to all versions of the old module path. If the @v in new@v is omitted, +the new path should be a local module root directory, not a module +path. Note that -replace overrides any redundant replacements for old[@v], +so omitting @v will drop existing replacements for specific versions. + +The -dropreplace=old[@v] flag drops a replacement of the given +module path and version pair. If the @v is omitted, a replacement without +a version on the left side is dropped. The -require, -droprequire, -exclude, -dropexclude, -replace, and -dropreplace editing flags may be repeated, and the changes |