Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Context.RoutePattern() nil-safe #927

Merged
merged 1 commit into from
Aug 23, 2024
Merged

Make Context.RoutePattern() nil-safe #927

merged 1 commit into from
Aug 23, 2024

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