Re: [go-nuts] find module of dependent package

2019-12-23 Thread Dan Kortschak
Solved thanks to Daniel Martí; use `go list -json` and grab the Module struct out of that. On Tue, 2019-12-24 at 09:50 +1030, Dan Kortschak wrote: > Say I have a package path, "host.org/user/depmodule/pkgdep", which is > the path to a dependency of "host.org/user/repomain/pkgmain". The > go.mod fi

[go-nuts] find module of dependent package

2019-12-23 Thread Dan Kortschak
Say I have a package path, "host.org/user/depmodule/pkgdep", which is the path to a dependency of "host.org/user/repomain/pkgmain". The go.mod file in host.org/user/repomain will have a line "host.org/user/depmodule" in the require block. If I want to programmatically find what the module path is f