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

proposal: module-aware gomodmerge #1

Open
myitcv opened this issue Oct 31, 2018 · 0 comments
Open

proposal: module-aware gomodmerge #1

myitcv opened this issue Oct 31, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@myitcv
Copy link

myitcv commented Oct 31, 2018

Consider https://gist.github.com/myitcv/f7270ab81ab45aa286f496264f034b56

The use of gohack just to achieve a temporary go.mod that can then be used by gomodmerge is a bit verbose to say the least.

Instead, it might be better to have gomodmerge understand modules and hence be able to automate a lot of this (in a temporary directory).

Taking the linked example, this would transform:

$ gohack get -vcs github.com/docker/docker
$ docker=$(go list -m -f "{{.Dir}}" github.com/docker/docker)
$ pushd $docker
$ rm go.mod
$ go mod init
$ go mod tidy
$ popd
$ gohack undo github.com/docker/docker
$ gomodmerge $docker/go.mod

to simply:

$ gomodmerge github.com/docker/docker

where the version of github.com/docker/docker is resolved via the main module's go.mod in the "usual way".

@rogpeppe rogpeppe added the enhancement New feature or request label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants