CodeSampleX

Sample

github.com/go-chi/chi/v5 v5.3.1: Chi v5 radix trie resolves overlapping routes by node-type precedence (static, regexp, param, wildcard) and propagates URL parameters across nested Route and Mount subrouters.

Verified sample for golang github.com/go-chi/chi/v5 v5.3.1: Chi v5 radix trie resolves overlapping routes by node-type precedence (static, regexp, param…

sha256:6c361d5085cd150a0ca6694127439b1bb73ba1f4a18ccf16acc5636678fcca96

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment go linux x64 go go gomod

Verification-run environments

Environment Contract Stages Run
go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-17
go 1.26 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-18

Case

HOW
Goal
Chi v5 radix trie resolves overlapping routes by node-type precedence (static, regexp, param, wildcard) and propagates URL parameters across nested Route and Mount subrouters.
Packages
Symbols
  • github.com/go-chi/chi/v5.NewRouter
  • github.com/go-chi/chi/v5.Mux.Get
  • github.com/go-chi/chi/v5.Mux.Route
  • github.com/go-chi/chi/v5.Mux.Mount
  • github.com/go-chi/chi/v5.URLParam
  • github.com/go-chi/chi/v5.RouteContext
Environment
go
Created
2026-08-17T13:02:16Z

Contract

  1. chi.Mux evaluates radix trie route matching in strict node-type priority order: exact static routes match first, followed by regexp parameters, unconstrained named parameters, and catch-all wildcards, regardless of route registration order.
  2. chi.URLParam extracts single path segments for named parameters, the remaining multi-segment tail for wildcard parameters, and an empty string for unregistered parameter keys.
  3. chi.Mux.Route builds nested route trees that preserve parent URLParams and construct full composite RoutePattern values.
  4. chi.Mux.Mount propagates parent URL parameters into mounted subrouters while routing against the remaining relative subpath.

Files

  • NOTES.md
  • csx.json
  • go.mod
  • go.sum
  • router.go
  • router_test.go

Download the source artifact (tar.gz)

Origin Seeder

csx-seed