mirror of
https://github.com/labstack/echo.git
synced 2024-11-28 08:38:39 +02:00
Fixed build error
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
e7c1d5d9fb
commit
80a4b41e16
3
echo.go
3
echo.go
@ -141,10 +141,11 @@ var (
|
|||||||
|
|
||||||
// New creates an Echo instance.
|
// New creates an Echo instance.
|
||||||
func New() (e *Echo) {
|
func New() (e *Echo) {
|
||||||
e = &Echo{maxParam: new(int), router: NewRouter(e)}
|
e = &Echo{maxParam: new(int)}
|
||||||
e.pool.New = func() interface{} {
|
e.pool.New = func() interface{} {
|
||||||
return NewContext(nil, new(Response), e)
|
return NewContext(nil, new(Response), e)
|
||||||
}
|
}
|
||||||
|
e.router = NewRouter(e)
|
||||||
|
|
||||||
//----------
|
//----------
|
||||||
// Defaults
|
// Defaults
|
||||||
|
@ -302,7 +302,7 @@ func (r *Router) Find(method, path string, ctx *Context) (h HandlerFunc, e *Echo
|
|||||||
c = cn.findMchild()
|
c = cn.findMchild()
|
||||||
if c != nil {
|
if c != nil {
|
||||||
cn = c
|
cn = c
|
||||||
ctx.pvalues[n] = search
|
ctx.pvalues[0] = search
|
||||||
search = "" // End search
|
search = "" // End search
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -469,6 +469,7 @@ func TestRouterPriority(t *testing.T) {
|
|||||||
if assert.NotNil(t, h) {
|
if assert.NotNil(t, h) {
|
||||||
h(c)
|
h(c)
|
||||||
assert.Equal(t, 7, c.Get("g"))
|
assert.Equal(t, 7, c.Get("g"))
|
||||||
|
assert.Equal(t, "joe/books", c.Param("_name"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user