Update doc.go: r.AddMiddleware(...) -> r.Use(...)
This commit is contained in:
2
doc.go
2
doc.go
@@ -261,7 +261,7 @@ Middlewares can be added to a router using `Router.Use()`:
|
|||||||
|
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/", handler)
|
r.HandleFunc("/", handler)
|
||||||
r.AddMiddleware(simpleMw)
|
r.Use(simpleMw)
|
||||||
|
|
||||||
A more complex authentication middleware, which maps session token to users, could be written as:
|
A more complex authentication middleware, which maps session token to users, could be written as:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user