aboutsummaryrefslogtreecommitdiff
path: root/doc.go
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2014-01-13 09:04:58 +0400
committerKamil Kisiel <kamil@kamilkisiel.net>2014-01-13 09:04:58 +0400
commit457fd4107651cbcf7cfb3f217a1711e1dbd653c7 (patch)
treefb080c3c70d5910be7522ba9e17997424e6fdaf8 /doc.go
parent481304761212af180bac73d15bf3f02d6584f801 (diff)
parent44fb592008c2ecfbfc89725a8ae1638711dfa423 (diff)
Merge pull request #23 from ancarda/patch-1
Added note about memory leak (Fixes #15)
Diffstat (limited to 'doc.go')
-rw-r--r--doc.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc.go b/doc.go
index c8eb758..feeddd0 100644
--- a/doc.go
+++ b/doc.go
@@ -48,6 +48,12 @@ 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.
+
+ http.ListenAndServe(":8080", context.ClearHandler(http.DefaultServeMux))
+
That's all you need to know for the basic usage. Let's take a look at other
options, starting with flash messages.