package
Version:
v0.1.3
Opens a new window with list of versions in this module.
Published: Nov 6, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package clock 提供可注入的时钟,便于测试定时器与历史时间。
type Clock interface {
Now() time.Time
}
Clock 是时间源接口。
Fake 是可控时钟,并发安全。
NewFake 创建假时钟。
@param now 初始时间
@return 假时钟
Advance 推进时间。
@param d 推进时长
Source Files
¶
Click to show internal directories.
Click to hide internal directories.