MCPcopy
hub / github.com/gofiber/fiber / URL

Method URL

router.go:88–94  ·  view source on GitHub ↗

URL generates a URL from the route path and parameters. This method fills in the route parameters with the provided values. Parameter matching respects the app's CaseSensitive configuration: case-insensitive by default, case-sensitive when CaseSensitive is true. Example: app.Get("/user/:name/:id"

(params Map)

Source from the content-addressed store, hash-verified

86//
87//nolint:gocritic // hugeParam: app.GetRoute returns a value, so URL must be callable on that value directly.
88func (r Route) URL(params Map) (string, error) {
89 if r.Path == "" {
90 return "", ErrNotFound
91 }
92
93 return buildRouteURL(&r, params)
94}
95
96// buildRouteURL generates a URL from route segments and parameters.
97// This shared helper is used by both Route.URL() and DefaultRes.getLocationFromRoute()

Callers 1

Test_Route_URLFunction · 0.95

Calls 1

buildRouteURLFunction · 0.85

Tested by 1

Test_Route_URLFunction · 0.76