In the company I work at, we have several backend systems written in Go and some of the code is shared between them. The backend systems need to be deployed separately, potentially on different machines. All of these projects are still under active development and change quite often.
We are trying to come up with a good way of managing our git repositories and the dependencies between them.
At the moment we have one repository for the shared code, lets call it backend-shared. Then we have a separate repository for each backend system, lets call them backend1 and backend2. In turn each backend has a Godep dependency on backend-shared.
As far as I understand, the preferred method of dependency management in Golang is via vendoring, according to which all dependencies are copied into the /vendor directory, and should be checked into the version control. This way, all dependencies are locked to specific versions.
This works fine for our external dependencies, however for the internal dependency on backend-shared, it becomes quite cumbersome since it isn't unusual for a developer to have to simultaneously make changes to both a specific backend system as well as backend-shared.
Right now, if a change is made to the backend-shared that resides in the developer's GOPATH, that change wouldn't be visible inside the backend1 (also in GOPATH) because backend1 will first look at the stale copy of backend-shared inside its /vendor directory.
Thus, we either have to re-vendor backend1 in order to copy the new version of backend-shared, or we would have to temporarily remove backend-shared from the /vendor directory in order for the imports to point to the version inside the GOPATH. Both of these options feel potentially dirty and I am not sure if they are the way Go is meant to be used.
My question is if there is a better way to keep our current repositories and simplify the development of multiple projects at once?
Or should we combine all repositories into a single one, given that right now their development life-cycles are rather intertwined even if dependency wise backend1 and backend2 are separate?
The main reason we didn't begin with a single repository containing backend1, backend2 and backend-shared is that backend1 and backend2 must be deployed separately, so we wanted to have their code also physically separated.