GetIntDefault same as `Get` but returns its int representation, if key doesn't exist then it returns the "defaultValue".
(key string, defaultValue int)
| 255 | // GetIntDefault same as `Get` but returns its int representation, |
| 256 | // if key doesn't exist then it returns the "defaultValue". |
| 257 | func (s *Session) GetIntDefault(key string, defaultValue int) int { |
| 258 | if v, err := s.GetInt(key); err == nil { |
| 259 | return v |
| 260 | } |
| 261 | return defaultValue |
| 262 | } |
| 263 | |
| 264 | // Increment increments the stored int value saved as "key" by +"n". |
| 265 | // If value doesn't exist on that "key" then it creates one with the "n" as its value. |
no test coverage detected