My go project consists of many components. Every component has its own vendor directory, which is populated by the dep
. Because components have similar dependencies, there is a huge duplication in vendor directories.
Additionally, vendors are quite big: ~20MB.
My idea is to reduce the size of the repository by defining common vendor, on the top of the project.
project
vendor
|--component1
|----main.go
|----vendor
|--component2
|----main.go
|----vendor
Every component needs to define only dependencies specific to him.
To not provision common dependencies on every dep ensure
executed on the component level, we can specify which packages should be ignored in Gopkg.toml file:
ignored = ["github.com/aszecowka/calc"]
Question: Does anyone use this approach? Any alternatives?
Update Context: In my company we are investigating monorepo approach, we try to consolidate different go projects, but we end up with a really huge repository - mostly because of many vendors directories