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

x/tools/cmd/go-contrib-init: doesn't work with golang.org/x/mod repository #60602

Open
dolmen opened this issue Jun 5, 2023 · 3 comments
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@dolmen
Copy link
Contributor

dolmen commented Jun 5, 2023

go-contrib-init seems to only work with the main Go repo, not golang.org/x/* modules repositories.

What did you do?

I would like to contribute a patch to golang.org/x/mod. I'm following instructions from https://go.dev/doc/contribute#contrib_overview

$ git clone https://go.googlesource.com/mod golang.org-x-mod
$ cd golang.org-x-mod
$ go install golang.org/x/tools/cmd/go-contrib-init@latest
go: downloading golang.org/x/tools v0.9.3
$ go-contrib-init
Current directory's git was cloned from "https://go.googlesource.com/mod"; origin should be "https://go.googlesource.com/go"

What did you expect to see?

I expect go-contrib-init to also work with all golang.org/x/* modules.

What did you see instead?

Current directory's git was cloned from "https://go.googlesource.com/mod"; origin should be "https://go.googlesource.com/go"
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jun 5, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jun 5, 2023
@dr2chase
Copy link
Contributor

dr2chase commented Jun 6, 2023

@golang/tools-team

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 6, 2023
@hyangah
Copy link
Contributor

hyangah commented Jun 8, 2023

Can you try the -repo flag?

go-contrib-init -repo=mod

Looks like the tool predates the Go module and searches only GOPATH (https://github.com/golang/tools/blob/master/cmd/go-contrib-init/contrib.go#L45-64)
We need to fix the detection logic.

@gopherbot
Copy link

Change https://go.dev/cl/502176 mentions this issue: cmd/go-contrib-init: update to work with modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants