Browse Source

Fix nil panic in authentication middleware example (#489)

pull/490/head
Franklin Harding 7 years ago committed by Matt Silverlock
parent
commit
4248f5cd87
  1. 2
      doc.go

2
doc.go

@ -295,7 +295,7 @@ A more complex authentication middleware, which maps session token to users, cou @@ -295,7 +295,7 @@ A more complex authentication middleware, which maps session token to users, cou
r := mux.NewRouter()
r.HandleFunc("/", handler)
amw := authenticationMiddleware{}
amw := authenticationMiddleware{tokenUsers: make(map[string]string)}
amw.Populate()
r.Use(amw.Middleware)

Loading…
Cancel
Save