Using a Monorepo to publish Lean Go Packages with Workspaces
As a developer who works with Go in my day-to-day development, I constantly struggle with third party packages or tools which bring in a lot of dependencies. This is especially true when you’re trying to keep your project dependencies up to date, while dependabot, and other security software, is screaming about vulnerabilities in dependencies of dependencies. This is especially a problem with two common packages I use: Any HTTP adaptor package, which ships with integrations for multiple server packages, such as Gin, Echo, and others. Any package which uses docker to test with containers. Projects which include examples with their own dependencies. To break this cycle in my own projects, and packages I publish privately in work projects, I have adopted the use of Go workspaces, which allows me to create a monorepo broken up into multiple packages, and then publish one or more of these packages. ...