Skip to content

Commit

Permalink
Change Clock to empty struct in nosql/nosql | truncate > round
Browse files Browse the repository at this point in the history
- saves space
-
  • Loading branch information
dopey committed Apr 13, 2021
1 parent 672e3f9 commit 63ec2e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acme/db/nosql/nosql.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ func randID() (val string, err error) {
}

// Clock that returns time in UTC rounded to seconds.
type Clock int
type Clock struct{}

// Now returns the UTC time rounded to seconds.
func (c *Clock) Now() time.Time {
return time.Now().UTC().Round(time.Second)
return time.Now().UTC().Truncate(time.Second)
}

var clock = new(Clock)

0 comments on commit 63ec2e3

Please sign in to comment.