mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
param alias, context#param
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
b358b06311
commit
fd9508ca39
@ -237,7 +237,7 @@ func (c *context) SetPath(p string) {
|
||||
|
||||
func (c *context) Param(name string) string {
|
||||
for i, n := range c.pnames {
|
||||
if i < len(c.pnames) {
|
||||
if i < len(c.pvalues) {
|
||||
if n == name {
|
||||
return c.pvalues[i]
|
||||
}
|
||||
|
@ -177,8 +177,8 @@ func (r *Router) insert(method, path string, h HandlerFunc, t kind, ppath string
|
||||
}
|
||||
for i, n := range pnames {
|
||||
// Param name aliases
|
||||
if !strings.Contains(n, pnames[i]) {
|
||||
cn.pnames[i] += "," + pnames[i]
|
||||
if i < len(cn.pnames) && !strings.Contains(cn.pnames[i], n) {
|
||||
cn.pnames[i] += "," + n
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user