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

Unexpected Group behaviour #852

Closed
tandem97 opened this issue Sep 20, 2023 · 1 comment
Closed

Unexpected Group behaviour #852

tandem97 opened this issue Sep 20, 2023 · 1 comment

Comments

@tandem97
Copy link

tandem97 commented Sep 20, 2023

Hi! I found strange behaviour using groups. I can't classify it is feature or a bug. This code is not working as i expected:

package main

import (
	"net/http"

	"github.com/go-chi/chi/v5"
	"github.com/go-chi/chi/v5/middleware"
)

func main() {
	r1 := chi.NewMux().Group(
		func(r chi.Router) {
			r.Use(middleware.Logger)
			r.Group(func(r chi.Router) {
				r.Get("/test", http.HandlerFunc(f))
			})
		},
	)
	http.ListenAndServe(":80", r1)
}
@VojtechVitek
Copy link
Contributor

not really a bug report :)

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

No branches or pull requests

3 participants