From 4248f5cd8717eaea35eded08100714b2b2bac756 Mon Sep 17 00:00:00 2001 From: Franklin Harding <32021905+fharding1@users.noreply.github.com> Date: Fri, 28 Jun 2019 08:33:07 -0700 Subject: [PATCH] Fix nil panic in authentication middleware example (#489) --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc.go b/doc.go index 38957de..bd5a38b 100644 --- a/doc.go +++ b/doc.go @@ -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)