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

Removes ambiguity around "fresh middleware stack" in GoDoc #862

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

TheRandomCharacter
Copy link
Contributor

For Group():

fresh implies that a new empty middleware stack is created, while in fact the parent's stack is copied.

For Route():

Looks like with a fresh middleware stack was added to emphasize that while the parent middleware stack is frozen, one can still add middlewares to new router's stack before starting to define routes on it.

In my opinion this is clear from creates a new Mux. Adding with a fresh middleware stack makes it more obscure that the parent middleware stack will be executed wrapping the new one.

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pkieltyka pkieltyka merged commit 834f94d into go-chi:master Oct 18, 2023
14 checks passed
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.

3 participants