Skip to content

Instantly share code, notes, and snippets.

@rpromyshlennikov
Created March 16, 2018 13:31
Show Gist options
  • Save rpromyshlennikov/41e2185ac6a1ceff5189bd29a227ab6e to your computer and use it in GitHub Desktop.
Save rpromyshlennikov/41e2185ac6a1ceff5189bd29a227ab6e to your computer and use it in GitHub Desktop.
Gorilla mux router walk function
router.Walk(
func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
fmt.Println(route.GetPathRegexp())
fmt.Println(route.GetHostTemplate())
fmt.Println(route.GetPathTemplate())
fmt.Println(route.GetMethods())
return nil
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment