func OptPathParameterized(format string, params map[string]string) Option {
	return func(r *Request) error {
		if r.Request == nil {
			return ex.New(ErrRequestUnset)
		}

		if !strings.HasPrefix(format, "/") {
			format = "/" + format
		}

		path, err := stringutil.ReplacePathParameters(format, params)
		if err != nil {
			return err
		}

		ctx := r.Request.Context()
		r.WithContext(WithParameterizedPath(ctx, format))

		return OptPath(path)(r)
	}
}
// OptPathParameterized sets the url path based on a parameterized path and arguments.
// Parameterized paths should appear in the same format as paths you would add to your
// web app (ex. `/resource/:resource_id`).
OptPathParameterized sets the url path based on a parameterized path and arguments.
Parameterized paths should appear in the same format as paths you would add to your
web app (ex. `/resource/:resource_id`).
// OptPathParameterized sets the url path based on a parameterized path and arguments . // Parameterized paths should appear in the same format as paths you would add to your // web app ( ex . ` / resource / : resource_id ` ) .
func OptPathParameterized(format string, params map[string]string) Option {
	return func(r *Request) error {
		if r.Request == nil {
			return ex.New(ErrRequestUnset)
		}
		if !strings.HasPrefix(format, "/") {
			format = "/" + format
		}
		path, err := stringutil.ReplacePathParameters(format, params)
		if err != nil {
			return err
		}
		ctx := r.Request.Context()
		r.WithContext(WithParameterizedPath(ctx, format))
		return OptPath(path)(r)
	}
}
func OptPathParameterized ( format string , params map [ string ] string ) Option { return func ( r * Request ) error { if r . Request == nil { return ex . New ( ErrRequestUnset ) } if ! strings . HasPrefix ( format , " " ) { format = " " + format } path , err := stringutil . ReplacePathParameters ( format , params ) if err != nil { return err } ctx := r . Request . Context ( ) r . WithContext ( WithParameterizedPath ( ctx , format ) ) return OptPath ( path ) ( r ) } }
OptPathParameterized sets the url path based on a parameterized path and arguments.
OptPathParameterized sets the url path based on a parameterized path and arguments .