add NewFlash func
Showing
1 changed file
with
6 additions
and
0 deletions
| ... | @@ -10,6 +10,12 @@ type FlashData struct { | ... | @@ -10,6 +10,12 @@ type FlashData struct { |
| 10 | Data map[string]string | 10 | Data map[string]string |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | func NewFlash() *FlashData{ | ||
| 14 | return &FlashData{ | ||
| 15 | Data:make(map[string]string) | ||
| 16 | } | ||
| 17 | } | ||
| 18 | |||
| 13 | func (fd *FlashData) Notice(msg string, args ...interface{}) { | 19 | func (fd *FlashData) Notice(msg string, args ...interface{}) { |
| 14 | if len(args) == 0 { | 20 | if len(args) == 0 { |
| 15 | fd.Data["notice"] = msg | 21 | fd.Data["notice"] = msg | ... | ... |
-
Please register or sign in to post a comment