Skip to content

Commit

Permalink
Removes ambiguity around "fresh middleware stack" in GoDoc (#862)
Browse files Browse the repository at this point in the history
Co-authored-by: TheRandomCharacter <[email protected]>
  • Loading branch information
TheRandomCharacter and TheRandomCharacter authored Oct 18, 2023
1 parent f250983 commit 834f94d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (mx *Mux) With(middlewares ...func(http.Handler) http.Handler) Router {
return im
}

// Group creates a new inline-Mux with a fresh middleware stack. It's useful
// Group creates a new inline-Mux with a copy of middleware stack. It's useful
// for a group of handlers along the same routing path that use an additional
// set of middlewares. See _examples/.
func (mx *Mux) Group(fn func(r Router)) Router {
Expand All @@ -261,9 +261,8 @@ func (mx *Mux) Group(fn func(r Router)) Router {
return im
}

// Route creates a new Mux with a fresh middleware stack and mounts it
// along the `pattern` as a subrouter. Effectively, this is a short-hand
// call to Mount. See _examples/.
// Route creates a new Mux and mounts it along the `pattern` as a subrouter.
// Effectively, this is a short-hand call to Mount. See _examples/.
func (mx *Mux) Route(pattern string, fn func(r Router)) Router {
if fn == nil {
panic(fmt.Sprintf("chi: attempting to Route() a nil subrouter on '%s'", pattern))
Expand Down

0 comments on commit 834f94d

Please sign in to comment.