Fix #252 typo (middlewares -> middleware)

This commit is contained in:
Javier Provecho Fernandez
2015-07-03 20:12:01 +02:00
parent d6425f1692
commit 7c0c427b2d
5 changed files with 29 additions and 29 deletions

8
gin.go
View File

@ -23,7 +23,7 @@ type (
HandlerFunc func(*Context)
HandlersChain []HandlerFunc
// Represents the web framework, it wraps the blazing fast httprouter multiplexer and a list of global middlewares.
// Represents the web framework, it wraps the blazing fast httprouter multiplexer and a list of global middleware.
Engine struct {
RouterGroup
HTMLRender render.HTMLRender
@ -139,11 +139,11 @@ func (engine *Engine) NoMethod(handlers ...HandlerFunc) {
engine.rebuild405Handlers()
}
// Attachs a global middleware to the router. ie. the middlewares attached though Use() will be
// Attachs a global middleware to the router. ie. the middleware 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 {
engine.RouterGroup.Use(middlewares...)
func (engine *Engine) Use(middleware ...HandlerFunc) routesInterface {
engine.RouterGroup.Use(middleware...)
engine.rebuild404Handlers()
engine.rebuild405Handlers()
return engine