Skip to main content
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.
  1. https://registry.bazel.build/modules/rules_go supports monorepo first-party packages
  2. https://registry.bazel.build/modules/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 https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md.