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: perhaps misleading 'require new/thing v2.3.4' example in documentation #28374

thepudds opened this issue Oct 24, 2018 · 1 comment


None yet
3 participants
Copy link

commented Oct 24, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

Tip (devel +0e40889796 Wed Oct 24 21:23:54 2018 +0000).

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?


What did you do?

Go to:

What did you see?

The documentation section on "The go.mod file" includes what I think might be a misleading example require directive:

require new/thing v2.3.4

I suspect that would not be representative of how the 1.11 tooling would write that after resolving any module queries. In other words, I would expect that example require to either include the /v2:

require new/thing/v2 v2.3.4

or include +incompatible:

require new/thing v2.3.4+incompatible 

or perhaps something else.

I've seen people get confused on whether or not the /vN is required in a require directive for a v2+ dependency that has opted in to modules, so might be worth updating that example.

For context, here is a slightly larger snippet from the doc:

Each line holds a single directive, made up of a verb followed by arguments. For example:

module my/thing
require other/thing v1.0.2
require new/thing v2.3.4
exclude old/thing v1.2.3
replace bad/thing v1.4.5 => good/thing v1.4.5

@thepudds thepudds added the modules label Oct 24, 2018

@bcmills bcmills added the NeedsFix label Oct 25, 2018

@bcmills bcmills added this to the Go1.12 milestone Oct 25, 2018


This comment has been minimized.

Copy link

commented Oct 26, 2018

Change mentions this issue: cmd/go: Improve documentation not to mislead

@gopherbot gopherbot closed this in 0b071e4 Nov 7, 2018

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