From 96a5fdda5c95c7dfbca04f1f643d82f85a7b456c Mon Sep 17 00:00:00 2001 From: Kamil Kisiel Date: Sun, 12 Jan 2014 21:06:25 -0800 Subject: Clarify docs a bit. --- doc.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'doc.go') 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. -- cgit v1.2.3