Change Clock to empty struct in nosql/nosql | truncate > round

- saves space
-
This commit is contained in:
max furman 2021-04-13 14:42:13 -07:00
parent 672e3f976e
commit 63ec2e35b0

View file

@ -86,11 +86,11 @@ func randID() (val string, err error) {
} }
// Clock that returns time in UTC rounded to seconds. // Clock that returns time in UTC rounded to seconds.
type Clock int type Clock struct{}
// Now returns the UTC time rounded to seconds. // Now returns the UTC time rounded to seconds.
func (c *Clock) Now() time.Time { func (c *Clock) Now() time.Time {
return time.Now().UTC().Round(time.Second) return time.Now().UTC().Truncate(time.Second)
} }
var clock = new(Clock) var clock = new(Clock)