Update README to reflect API change: IncrementFloat now only works on float32 and float64, and the use of Decrement should be encouraged over Increment (with a negative number) since Increment converting a negative signed integer to an unsigned integer probably isn't the intended behavior
This commit is contained in:
parent
b3a957a46c
commit
72916cf4df
12
README
12
README
|
@ -119,15 +119,13 @@ func (c *Cache) Increment(k string, n int64) error
|
||||||
Increment an item of type int, int8, int16, int32, int64, uintptr, uint,
|
Increment an item of type int, int8, int16, int32, int64, uintptr, uint,
|
||||||
uint8, uint32, or uint64, float32 or float64 by n. Returns an error if the
|
uint8, uint32, or uint64, float32 or float64 by n. Returns an error if the
|
||||||
item's value is not an integer, if it was not found, or if it is not
|
item's value is not an integer, if it was not found, or if it is not
|
||||||
possible to increment it by n. Passing a negative number will cause the item
|
possible to increment it by n.
|
||||||
to be decremented.
|
|
||||||
|
|
||||||
func (c *Cache) IncrementFloat(k string, n float64) error
|
func (c *Cache) IncrementFloat(k string, n float64) error
|
||||||
Increment an item of type int, int8, int16, int32, int64, uintptr, uint,
|
Increment an item of type float32 or float64 by n. Returns an error if the
|
||||||
uint8, uint32, or uint64, float32 or float64 by n. Returns an error if the
|
item's value is not floating point, if it was not found, or if it is not
|
||||||
item's value is not an integer, if it was not found, or if it is not
|
possible to increment it by n. Pass a negative number to decrement the
|
||||||
possible to increment it by n. Passing a negative number will cause the item
|
value.
|
||||||
to be decremented.
|
|
||||||
|
|
||||||
func (c *Cache) Decrement(k string, n int64) error
|
func (c *Cache) Decrement(k string, n int64) error
|
||||||
Decrement an item of type int, int8, int16, int32, int64, uintptr, uint,
|
Decrement an item of type int, int8, int16, int32, int64, uintptr, uint,
|
||||||
|
|
Loading…
Reference in New Issue