Skip to content

cmd/go: fix go get with ... fails in module mode #29606

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

Closed
wants to merge 5 commits into from
Closed

cmd/go: fix go get with ... fails in module mode #29606

wants to merge 5 commits into from

Conversation

hxzhao527
Copy link

There is a mistake about haveGoFiles detection in modload, and it caused go get with ... fails in module mode.

Fixes #29363

@googlebot googlebot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Jan 8, 2019
@gopherbot
Copy link
Contributor

This PR (HEAD: 6100917) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/156757 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/156757.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 5bed726) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/156757 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 8ee6f32) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/156757 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 3:

Could you add a test?


Please don’t reply on this GitHub thread. Visit golang.org/cl/156757.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 浩翔 赵:

Patch Set 3:

Patch Set 3:

Could you add a test?

emmm, I don't know how to append a test to import_test.go.
I just test this by the go get command.
Let me find a way to test this properly. Maybe need some moments.


Please don’t reply on this GitHub thread. Visit golang.org/cl/156757.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: ec931ff) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/156757 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from 浩翔 赵:

Patch Set 4:

Test added.

I can't access vcs-test.golang.org/git/querytest.git, so I just use github.com/google/codesearch as the test target.


Please don’t reply on this GitHub thread. Visit golang.org/cl/156757.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 2fa1ed8) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/156757 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: f2dd48b) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/156757 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@hxzhao527
Copy link
Author

/comments off

@hxzhao527
Copy link
Author

@bcmills Hi here. I'm sorry, but the Gerrit is too difficult for me to send a comment.
I doubt about why we need a fix for the general case.

Now go get in mod mode is not always failed, just when the package not in module dependencies.
As the #27215 shows, we can call go get golang.org/x/perf/cmd/benchstat and then go get golang.org/x/perf/cmd/..., even go get golang.org/x/perf/...cmd/....

After the first go get add the package to module dependencies, everything works.
So the first call is the just one needed to fix. Is this correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cmd/go: go get with ... fails in module mode
3 participants