RoutesInterface includes Group()

This commit is contained in:
Manu Mtz-Almeida
2015-06-26 16:01:35 +02:00
parent 88a65eacff
commit 9e44079756
2 changed files with 38 additions and 29 deletions

4
gin.go
View File

@ -70,6 +70,8 @@ type (
}
)
var _ RoutesInterface = &Engine{}
func (c HandlersChain) Last() HandlerFunc {
length := len(c)
if length > 0 {
@ -157,7 +159,7 @@ func (engine *Engine) NoMethod(handlers ...HandlerFunc) {
// Attachs a global middleware to the router. ie. the middlewares attached though Use() will be
// included in the handlers chain for every single request. Even 404, 405, static files...
// For example, this is the right place for a logger or error management middleware.
func (engine *Engine) Use(middlewares ...HandlerFunc) RoutesInterface {
func (engine *Engine) Use(middlewares ...HandlerFunc) routesInterface {
engine.RouterGroup.Use(middlewares...)
engine.rebuild404Handlers()
engine.rebuild405Handlers()