Skip to content

Make Context.RoutePattern() nil-safe#927

Merged
pkieltyka merged 1 commit into
go-chi:masterfrom
gaiaz-iusipov:nil-safe-route-pattern
Aug 23, 2024
Merged

Make Context.RoutePattern() nil-safe#927
pkieltyka merged 1 commit into
go-chi:masterfrom
gaiaz-iusipov:nil-safe-route-pattern

Conversation

@gaiaz-iusipov
Copy link
Copy Markdown
Contributor

I propose to make the Context.RoutePattern() method nil-safe. Usage example:

if routePattern := chi.RouteContext(req.Context()).RoutePattern(); routePattern != "" {
    // ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants