On Tue, Jul 17, 2018, at 07:36, Jan Mercl wrote:
> I do see a good reason to have the source repository available. To be able
> to run `go test` using the ton of test data that sits in the repository,
> for example. This is not a use case like typing `$ wget ...` in the
> terminal. Developers are also _users_, just with special/additional needs.
If you still need to get access to the sources at runtime, you can probably load them from $GOPATH/src/mod (which is where the new system will stick them). You'll also need to know the version now but I supect there are various things you could do about that (always use latest, embed your go.mod in the binary at build time and use the version from that, etc.)
You can always use Go's loader to get this information too, I think the new one supports the new state of the world already:
https://godoc.org/golang.org/x/tools/go/packages#Package
—Sam