You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this blog post, it is stated that the URL for a particular route can be created on the fly with the following method:
url:=router.Url("homeHandler")
However, trying to access the Url method yields the following error:
router.Url undefined (type *gin.Engine has no field or method Url)
In what seems to be a fork of Gin 1.7.4, I've found the URLFor function, but I'm unable to find either the containing file template_func.go or the function URLFor in Gin's history. If anyone knows whether such a function has ever existed or something similar to it currently does exist, please shout!
Description
In this blog post, it is stated that the URL for a particular route can be created on the fly with the following method:
However, trying to access the
Url
method yields the following error:In what seems to be a fork of Gin 1.7.4, I've found the
URLFor
function, but I'm unable to find either the containing filetemplate_func.go
or the functionURLFor
in Gin's history. If anyone knows whether such a function has ever existed or something similar to it currently does exist, please shout!How to reproduce
Expectations
Given a
gin.Context
, I expect to be able to construct a route URL on a whim, anywhere in my application.Actual result
router.Url
is not a method, so it fails:Environment
go1.17.5 darwin/amd64
v1.8.1
The text was updated successfully, but these errors were encountered: