Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: confusing docs for -dropreplace #34930

Open
josharian opened this issue Oct 16, 2019 · 5 comments

Comments

@josharian
Copy link
Contributor

@josharian josharian commented Oct 16, 2019

I wanted to programmatically drop all replace directives for a particular module.

Based on the docs, I initially thought just using -dropreplace=old, with no @v, would drop all replace directives for that module path:

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.

It sounds from this like omitting the @v from a -dropreplace flag will make it apply to (drop) all versions with the old module path. What it actually does is drop any replace directives for that module path that do not specify a version.

It might be worth clarifying the docs a little.

@josharian josharian added the modules label Oct 16, 2019
@josharian

This comment has been minimized.

Copy link
Contributor Author

@josharian josharian commented Oct 17, 2019

Closing in favor of #34943.

@josharian josharian closed this Oct 17, 2019
@josharian josharian changed the title cmd/go: no straightforward way to remove old replace directives cmd/go: confusing docs for -dropreplace Oct 17, 2019
@josharian

This comment has been minimized.

Copy link
Contributor Author

@josharian josharian commented Oct 17, 2019

Re-opening as a documentation issue. Re-titled and edited content to make the concern clearer.

@julieqiu

This comment has been minimized.

Copy link

@julieqiu julieqiu commented Oct 18, 2019

@jayconrod jayconrod added this to the Go1.14 milestone Oct 18, 2019
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 5, 2019

Ping @jayconrod @bcmills . Let's write docs for 1.14 or move to backlog. Thanks.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 6, 2019

Change https://golang.org/cl/210340 mentions this issue: cmd/go: clarify -dropreplace help text in 'go help mod edit'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.