-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 get doesn't validate module arguments #71437
Comments
tool is a meta package, and go get accepts one or more packages. closing as working as intended |
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
meta modules should not be go got. I suggest to reopen this issue. |
you can |
Imho if I can‘t get/update a meta package, trying to do so should result in an error. |
At least BTW, |
|
The name is unfortunate in my opinion. And again, |
Kindly ping @aclements @ianlancetaylor Do you think it's a good idea to allow meta module names to be mixed with regular module paths? |
you may want it to set dependencies at specific versions. go get tool dont.upgrade/this@v0.1.0 |
Wouldnt that be the exact mistake I have made?
it should be? |
Is |
@aclements @ianlancetaylor @seankhliao It looks to me that using |
Did you hide my comment in #48429 (comment)? |
It looks that after running
the following two commands are equivalent:
In other words, tool dependencies and main dependencies are not distinguishable. |
It looks the |
I can definitely see the potential for confusion between It would not be viable to add a blanket rule that you can't mix meta-module names and regular module paths, since that's sure to break at least some existing usage. So the best we could do is a special case that disallows mixing specifically I'm inclined to leave this as is and not add any more complexity or special cases for this. The consequences of mistaking Maybe trying to |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Accidentally run (using either 1.24 or gotip)
What did you expect to see?
An error message since it should be
and "tool" cannot be added to the go.mod.
What did you see instead?
No error
The text was updated successfully, but these errors were encountered: