chi/pattern_fallback.go
Gusted d12cc49622
feat(mux): support http.Request.Pattern in Go 1.23 (#986)
Similar to #901

Adds support to get the pattern that was used by Chi to match the route,
without needing to call the Chi context.
2025-08-26 13:16:42 +02:00

17 lines
473 B
Go

//go:build !go1.23 || tinygo
// +build !go1.23 tinygo
package chi
import "net/http"
// supportsPattern is true if the Go version is 1.23 and above.
//
// If this is true, `net/http.Request` has field `Pattern`.
const supportsPattern = false
// setPattern sets the mux matched pattern in the http Request.
//
// setPattern is only supported in Go 1.23 and above so
// this is just a blank function so that it compiles.
func setPattern(rctx *Context, r *http.Request) {}