Setting up gRPC stub generation for Go and connecting them as a module
Keeping proto contracts in a single repository is convenient, but pulling the entire thing into every service is not. Let's walk through how to automatically generate Go stubs from proto files, version them as standalone Go modules, and publish them via GitLab CI/CD. Bonus: Swagger documentation and GitLab Pages.
Everything described here targets private free-tier GitLab. For self-hosted, paid plans, or public repositories the setup is considerably simpler — a number of the limitations simply don't apply.
Notes before you start
The approach requires some dev environment setup: standard SSH access to the repository and a few environment variables on each developer's machine:






