Like any language, Bazel must be taught how to work with Go. Unlike other languages however, the commonly used rules for Go are broken into two modules.
- Bazel Central Registry | rules_go supports monorepo first-party packages
- Bazel Central Registry | gazelle adds external packages, and generates the BUILD files for them.
This split can be confusing when searching for documentation, so try to keep it in mind!
Documentation
As of January 2025, the primary documentation for using modern Bazel (with bzlmod) is at Embed GitHub.