When there is just one go repository and it imports only public dependencies, deploying to (for example, a Docker container on AWS) is extremely straightforward.
However, I have a question about how to use subpackages with go.
Suppose we have a monorepo with 3 packages.
/src
- /appA
- /appB
- /someSharedDep
How are deployments typically built so that you deploy appA and someSharedDep to one server and appB and someSharedDep on another server?
I imagine there needs to be some creative employments of our friend the GOPATH, but some help on the topic would be appreciated.
Bonus points if we're talking about an elastic beanstalk deployment.
I have some thoughts on how to approach the problem now (and I'll add more or submit an answer if this becomes more complete).
./vendor
folder in the application. Yes you will have copies of the same code in two places but whatever.Some problems I still face:
package main
, usually in an ./example
subfolder. These have to be removed manually. I don't like editing the working source of someone else's project though!