Skip to content

Commit

Permalink
Judgment on whether adding testing time
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Oct 16, 2023
1 parent 920fd87 commit 7c828e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ func SetTestNow(carbon Carbon) Carbon {
// SetTestNow sets a test Carbon instance (real or mock) to be returned when a "now" instance is created.
func (c Carbon) SetTestNow(carbon Carbon) Carbon {
c.testNow = carbon.TimestampNano()
c.loc = carbon.loc
if carbon.loc != nil {
c.loc = carbon.loc
}
return c
}

Expand Down

0 comments on commit 7c828e3

Please sign in to comment.