March 2019
Intermediate to advanced
336 pages
9h 9m
English
IfExpired checks whether the cache object has expired. The IfExpired method of CacheObject returns true if TimeToLive has not expired; otherwise, it returns false. This is shown in the following code:
// IfExpired methodfunc (cacheObject CacheObject) IfExpired() bool { if cacheObject.TimeToLive == 0 { return false } return time.Now().UnixNano() > cacheObject.TimeToLive}
Read now
Unlock full access