Skip to content

Make Context.RoutePattern() nil-safe#927

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

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

Conversation

@gaiaz-iusipov
Copy link
Contributor

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

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

@pkieltyka pkieltyka merged commit 6fedde2 into go-chi:master Aug 23, 2024
@gaiaz-iusipov gaiaz-iusipov deleted the nil-safe-route-pattern branch August 23, 2024 21:03
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