gofmt
This commit is contained in:
parent
45dd777693
commit
c7d2d82d01
2
gin.go
2
gin.go
@ -63,7 +63,7 @@ type (
|
|||||||
|
|
||||||
RouteInfo struct {
|
RouteInfo struct {
|
||||||
Method string
|
Method string
|
||||||
Path string
|
Path string
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
16
gin_test.go
16
gin_test.go
@ -181,7 +181,7 @@ func compareFunc(t *testing.T, a, b interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestListOfRoutes(t *testing.T) {
|
func TestListOfRoutes(t *testing.T) {
|
||||||
handler := func(c *Context){}
|
handler := func(c *Context) {}
|
||||||
router := New()
|
router := New()
|
||||||
router.GET("/favicon.ico", handler)
|
router.GET("/favicon.ico", handler)
|
||||||
router.GET("/", handler)
|
router.GET("/", handler)
|
||||||
@ -198,31 +198,31 @@ func TestListOfRoutes(t *testing.T) {
|
|||||||
assert.Len(t, list, 7)
|
assert.Len(t, list, 7)
|
||||||
assert.Contains(t, list, RouteInfo{
|
assert.Contains(t, list, RouteInfo{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: "/favicon.ico",
|
Path: "/favicon.ico",
|
||||||
})
|
})
|
||||||
assert.Contains(t, list, RouteInfo{
|
assert.Contains(t, list, RouteInfo{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: "/",
|
Path: "/",
|
||||||
})
|
})
|
||||||
assert.Contains(t, list, RouteInfo{
|
assert.Contains(t, list, RouteInfo{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: "/users/",
|
Path: "/users/",
|
||||||
})
|
})
|
||||||
assert.Contains(t, list, RouteInfo{
|
assert.Contains(t, list, RouteInfo{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: "/users/:id",
|
Path: "/users/:id",
|
||||||
})
|
})
|
||||||
assert.Contains(t, list, RouteInfo{
|
assert.Contains(t, list, RouteInfo{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
Path: "/users/:id",
|
Path: "/users/:id",
|
||||||
})
|
})
|
||||||
assert.Contains(t, list, RouteInfo{
|
assert.Contains(t, list, RouteInfo{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: "/static/*filepath",
|
Path: "/static/*filepath",
|
||||||
})
|
})
|
||||||
assert.Contains(t, list, RouteInfo{
|
assert.Contains(t, list, RouteInfo{
|
||||||
Method: "HEAD",
|
Method: "HEAD",
|
||||||
Path: "/static/*filepath",
|
Path: "/static/*filepath",
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user