Open simonpasquier opened 5 years ago
I guess we would be within the second sample scenario:
if you have a repository with a complex set of dependencies, but you have a client API with a smaller set of dependencies. In some cases, it might make sense to have an api or clientapi or similar directory with its own go.mod, or to separate out that clientapi into its own repository.
@mxinden yes IMO.
This has been reported in https://github.com/prometheus/prometheus/issues/5813.
TL;DR: if project X wants to consume
github.com/prometheus/alertmanager/api/v2/client
, it needs to depend on thegithub.com/prometheus/alertmanager
module which pull dependencies that aren't really needed and can conflict with the own requirement constraints of project X.One solution would be to create a distinct module for the (generated) API v2 code (see https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories).