Skip to content
Permalink
Browse files

make the Flash#Persist function private

  • Loading branch information...
markbates committed Feb 3, 2017
1 parent 2081bbd commit 621e454b2cf10b32d38177aab7c6b262ec400574
Showing with 4 additions and 4 deletions.
  1. +2 −2 default_context.go
  2. +1 −1 flash.go
  3. +1 −1 handler.go
@@ -141,7 +141,7 @@ func (d *DefaultContext) Render(status int, rr render.Renderer) error {

if d.Session() != nil {
d.Flash().Clear()
d.Flash().Persist(d.Session())
d.Flash().persist(d.Session())
}

d.Response().Header().Set("Content-Type", rr.ContentType())
@@ -206,7 +206,7 @@ func (d *DefaultContext) Websocket() (*websocket.Conn, error) {

// Redirect a request with the given status to the given URL.
func (d *DefaultContext) Redirect(status int, url string, args ...interface{}) error {
d.Flash().Persist(d.Session())
d.Flash().persist(d.Session())

http.Redirect(d.Response(), d.Request(), fmt.Sprintf(url, args...), status)
return nil
@@ -36,7 +36,7 @@ func (f Flash) Add(key, value string) {
}

//Persist the flash inside the session.
func (f Flash) Persist(session *Session) {
func (f Flash) persist(session *Session) {
b, _ := json.Marshal(f.data)
session.Set(flashKey, b)
session.Save()
@@ -58,7 +58,7 @@ func (a *App) handlerToHandler(info RouteInfo, h Handler) http.Handler {
hf := func(res http.ResponseWriter, req *http.Request) {
c := a.newContext(info, res, req)

defer c.Flash().Persist(c.Session())
defer c.Flash().persist(c.Session())

err := a.Middleware.handler(h)(c)

0 comments on commit 621e454

Please sign in to comment.
You can’t perform that action at this time.