Decrement decrements the stored int value saved as "key" by -"n". If value doesn't exist on that "key" then it creates one with the "n" as its value. It returns the new, decremented, value even if it's less than zero.
(key string, n int)
| 275 | // If value doesn't exist on that "key" then it creates one with the "n" as its value. |
| 276 | // It returns the new, decremented, value even if it's less than zero. |
| 277 | func (s *Session) Decrement(key string, n int) (newValue int) { |
| 278 | newValue = s.GetIntDefault(key, 0) |
| 279 | newValue -= n |
| 280 | s.Set(key, newValue) |
| 281 | return |
| 282 | } |
| 283 | |
| 284 | // GetInt64 same as `Get` but returns its int64 representation, |
| 285 | // if key doesn't exist then it returns -1 and a non-nil error. |
nothing calls this directly
no test coverage detected