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

gohack of replaced modules does not work correctly #33

Open
rogpeppe opened this issue Oct 18, 2018 · 0 comments
Open

gohack of replaced modules does not work correctly #33

rogpeppe opened this issue Oct 18, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@rogpeppe
Copy link
Owner

When a go.mod file already contains a replacement of one module by another (not a directory), gohack get -vcs checks out the original repository, not the current replacement. Also, gohack get (without -vcs) does check out the correct code, but puts it in the directory for the original module, not the replacement module, which is probably wrong.

For example, given this go.mod:

module example.com/foo

require gopkg.in/errgo.v2 v2.0.0

replace gopkg.in/errgo.v2 => github.com/rogpeppe/test2/arble v0.0.0-20181008213029-f6022c873160

If we run gohack get -vcs gopkg.in/errgo.v2, it checks out gopkg.in/errgo.v2 to $GOHACK/gopkg.in/errgo.v2, where we actually want it to check out github.com/rogpeppe/test2/arble to $GOHACK/github.com/rogpeppe/test2/arble and end up with a go.mod file like this:

module example.com/foo

require gopkg.in/errgo.v2 v2.0.0

replace gopkg.in/errgo.v2 => /home/rog/gohack/github.com/rogpeppe/test2/arble // was gopkg.in/errgo.v2 => github.com/rogpeppe/test2/arble v0.0.0-20181008213029-f6022c873160
@rogpeppe rogpeppe added the bug Something isn't working label Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant