Imagine you have a project which requires two modules A
and B
. I will call the project module P
. Let's say that P
requires A v1.0.0
, B v1.1.0
and that A
requires B v1.0.0
. Furthermore B
did not adhered semantic versioning rules thus the version change from v1.0.0 -> v1.1.0
introduced a breaking API change. So
P
only builds with v1.1.0
and A
only builds with v1.0.0
.
Dependency graph:
P -> A (v1.0.0) -> B(v1.0.0)
P -> B (v1.1.0)
Is there any way to build this project with different versions. I heared about vendoring but I'm not sure if this would cause the dependency to use a different B
module version.
And if it could provide a solution for the conflicting package versions, does the go tool recognize modules using vendoring if the dependencies do not include a vendor folder (some people say, you should not upload the vendor folder) in their git repository (In this case module A
does not ship with a vendor folder, but the developer called go mod vendor
locally), does the go get command respect vendor folders of dependencies (or can it detect that the module used vendoring without an upstream vendor folder)?