summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2014-01-13 09:06:25 +0400
committerKamil Kisiel <kamil@kamilkisiel.net>2014-01-13 09:06:25 +0400
commit96a5fdda5c95c7dfbca04f1f643d82f85a7b456c (patch)
treebb811afc665032e63603a38a609fb2ad8ce60c02
parent457fd4107651cbcf7cfb3f217a1711e1dbd653c7 (diff)
Clarify docs a bit.
-rw-r--r--doc.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc.go b/doc.go
index feeddd0..7f8be22 100644
--- a/doc.go
+++ b/doc.go
@@ -48,12 +48,14 @@ And finally we call session.Save() to save the session in the response.
Note that in production code, we should check for errors when calling
session.Save(r, w), and either display an error message or otherwise handle it.
-Important Note: If you aren't using gorilla.Mux, you need to use
-context.ClearHandler as your handler on ListenAndServe else you will leak memory!
-The ClearHandler function is provided by the gorilla/context package.
+Important Note: If you aren't using gorilla/mux, you need to wrap your handlers
+with context.ClearHandler as or else you will leak memory! An easy way to do this
+is to wrap the top-level mux when calling http.ListenAndServe:
http.ListenAndServe(":8080", context.ClearHandler(http.DefaultServeMux))
+The ClearHandler function is provided by the gorilla/context package.
+
That's all you need to know for the basic usage. Let's take a look at other
options, starting with flash messages.