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

accept package path in 'gohack get' #62

Open
josharian opened this issue Oct 2, 2019 · 2 comments · May be fixed by #63
Open

accept package path in 'gohack get' #62

josharian opened this issue Oct 2, 2019 · 2 comments · May be fixed by #63

Comments

@josharian
Copy link
Contributor

$ gohack get -vcs github.com/rogpeppe/go-internal/modfile
module "github.com/rogpeppe/go-internal/modfile" does not appear to be in use
all modules failed; not replacing anything

The module is github.com/rogpeppe/go-internal. But the intent of the command was clear: I want to look at the package github.com/rogpeppe/go-internal/modfile. gohack get should accept a package path and start hacking on the containing module.

@josharian
Copy link
Contributor Author

Somewhere in cmd/go there must be a method that maps import paths to their containing modules. But I can't find it. I'm happy to work on implementing this if anyone can point me to that.

@bcmills
Copy link

bcmills commented Oct 2, 2019

@josharian,

go list -f '{{with .Module}}{{.Path}}{{end}}' github.com/rogpeppe/go-internal/modfile

will give you the module containing package github.com/rogpeppe/go-internal/modfile.

josharian added a commit to josharian/gohack that referenced this issue Oct 2, 2019
@josharian josharian linked a pull request Oct 2, 2019 that will close this issue
josharian added a commit to josharian/gohack that referenced this issue Oct 7, 2019
josharian added a commit to josharian/gohack that referenced this issue Oct 8, 2019
DO NOT MERGE

The test fails because go-internal's proxy
doesn't support .../@v/list requests.

Fixes rogpeppe#62
tmc pushed a commit to tmc/gohack that referenced this issue Jul 27, 2021
DO NOT MERGE

The test fails because go-internal's proxy
doesn't support .../@v/list requests.

Fixes rogpeppe#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants