File: export_test.go

package info (click to toggle)
golang-github-code-hex-go-generics-cache 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 216 kB
  • sloc: makefile: 2
file content (11 lines) | stat: -rw-r--r-- 179 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
package cache

import "time"

func SetNowFunc(tm time.Time) (reset func()) {
	backup := nowFunc
	nowFunc = func() time.Time { return tm }
	return func() {
		nowFunc = backup
	}
}