(app *App, w http.ResponseWriter, r *http.Request, session *sessions.Session)
| 52 | } |
| 53 | |
| 54 | func getSessionFlashes(app *App, w http.ResponseWriter, r *http.Request, session *sessions.Session) ([]string, error) { |
| 55 | var err error |
| 56 | if session == nil { |
| 57 | session, err = app.sessionStore.Get(r, cookieName) |
| 58 | if err != nil { |
| 59 | return nil, err |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | f := []string{} |
| 64 | if flashes := session.Flashes(); len(flashes) > 0 { |
| 65 | for _, flash := range flashes { |
| 66 | if str, ok := flash.(string); ok { |
| 67 | f = append(f, str) |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | saveUserSession(app, r, w) |
| 72 | |
| 73 | return f, nil |
| 74 | } |
| 75 | |
| 76 | func addSessionFlash(app *App, w http.ResponseWriter, r *http.Request, m string, session *sessions.Session) error { |
| 77 | var err error |
no test coverage detected