Skip to content

Why go_router_guards?

go_router_guards provides a middleware‑style guard system built for Go Router.

  • Unified guard model works for both type‑safe and traditional routes.
  • Composable pipelines (guardAll, guardAnyOf, guardOneOf) keep logic modular.
  • ConditionalGuard targets paths without duplicating logic.
  • Clear separation of concerns: guards decide, router executes.
  • Authentication/authorization checks before navigation.
  • Feature flags, maintenance mode, or runtime constraints.
  • Async rules (API checks, storage reads) that must resolve before continuing.
  • Pure view‑only state changes (prefer in‑page logic).
  • If your app has no pre‑navigation constraints.

See Core Concepts and the Get Started guide to try it out.