Skip to content

Commit

Permalink
Describe the meaning of 0 for Touch()'s seconds parameter (bradfitz#82)
Browse files Browse the repository at this point in the history
This is mentioned in the Expiration field of the Item struct (no
expiration time), but not in the notes about the Touch function.
  • Loading branch information
mostynb authored and bradfitz committed Jul 10, 2018
1 parent f867c99 commit bc664df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions memcache/memcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,9 @@ func (c *Client) Get(key string) (item *Item, err error) {

// Touch updates the expiry for the given key. The seconds parameter is either
// a Unix timestamp or, if seconds is less than 1 month, the number of seconds
// into the future at which time the item will expire. ErrCacheMiss is returned if the
// key is not in the cache. The key must be at most 250 bytes in length.
// into the future at which time the item will expire. Zero means the item has
// no expiration time. ErrCacheMiss is returned if the key is not in the cache.
// The key must be at most 250 bytes in length.
func (c *Client) Touch(key string, seconds int32) (err error) {
return c.withKeyAddr(key, func(addr net.Addr) error {
return c.touchFromAddr(addr, []string{key}, seconds)
Expand Down

0 comments on commit bc664df

Please sign in to comment.