12 lines
182 B
Go
12 lines
182 B
Go
|
|
package memcache
|
||
|
|
|
||
|
|
import "time"
|
||
|
|
|
||
|
|
func SetNowFunc(tm time.Time) (reset func()) {
|
||
|
|
backup := nowFunc
|
||
|
|
nowFunc = func() time.Time { return tm }
|
||
|
|
return func() {
|
||
|
|
nowFunc = backup
|
||
|
|
}
|
||
|
|
}
|