Fix #252 typo (middlewares -> middleware)
This commit is contained in:
8
gin.go
8
gin.go
@ -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
|
||||
|
Reference in New Issue
Block a user