Skip to content

feature: Router.Name() should create a NewRoute. #456

@seriousben

Description

@seriousben

Describe your problem

Most of the route's functions are exposed on the router for creating a new router. Unfortunately Name is not exposed as such.

For consistency, I believe it should be exposed.

Paste a minimal, runnable, reproduction of your issue below

r := mux.NewRouter()
// works
r.Handler("/path", httpHandler).Name("route name").Method("GET")
// works
r.Method("GET").Handler("/path2", httpHandler).Name("route2 name")
// is not supported
r.Name("route name").Method("GET").Handler("/path2", httpHandler)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions