GetStringDefault same as Get but returns its string representation, if key doesn't exist then it returns the "defaultValue".
(key string, defaultValue string)
| 152 | // GetStringDefault same as Get but returns its string representation, |
| 153 | // if key doesn't exist then it returns the "defaultValue". |
| 154 | func (s *Session) GetStringDefault(key string, defaultValue string) string { |
| 155 | if v := s.GetString(key); v != "" { |
| 156 | return v |
| 157 | } |
| 158 | |
| 159 | return defaultValue |
| 160 | } |
| 161 | |
| 162 | // GetFlashString same as `GetFlash` but returns its string representation, |
| 163 | // if key doesn't exist then it returns an empty string. |