From 32116905b797d9665fbae5cb1f465fe08e23d9c8 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Thu, 21 Aug 2025 10:05:39 -0500 Subject: [PATCH] add missing deleteflash method --- forms.go | 4 ++-- session.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/forms.go b/forms.go index b66522f..d91dc55 100644 --- a/forms.go +++ b/forms.go @@ -101,10 +101,10 @@ func (f FormValue) IsEmpty() bool { // GetFormArray gets multiple form values as string slice func (ctx Ctx) GetFormArray(key string) []string { var values []string - ctx.PostArgs().VisitAll(func(k, v []byte) { + for k, v := range ctx.PostArgs().All() { if string(k) == key { values = append(values, string(v)) } - }) + } return values } diff --git a/session.go b/session.go index 0fa2890..451c802 100644 --- a/session.go +++ b/session.go @@ -104,6 +104,10 @@ func (s *Session) GetFlash(key string) (any, bool) { return value, exists } +func (s *Session) DeleteFlash(key string) { + s.Delete("flash_" + key) +} + func (s *Session) GetFlashMessage(key string) string { if flash, exists := s.GetFlash(key); exists { if msg, ok := flash.(string); ok {