Skip to content

Commit 440373b

Browse files
committed
Replaces time.Now with now variable.
1 parent 0a66284 commit 440373b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bson/encode_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ func reflectionEncoderTest(t *testing.T) {
361361
oids := []objectid.ObjectID{objectid.New(), objectid.New(), objectid.New()}
362362
var str = new(string)
363363
*str = "bar"
364+
now := time.Now()
364365

365366
testCases := []struct {
366367
name string
@@ -856,7 +857,7 @@ func reflectionEncoderTest(t *testing.T) {
856857
W: nil,
857858
X: []map[struct{}]struct{}{}, // Should be empty BSON Array
858859
Y: []map[struct{}]struct{}{{}}, // Should be BSON array with one element, an empty BSON SubDocument
859-
Z: time.Now(),
860+
Z: now,
860861
},
861862
docToBytes(NewDocument(
862863
EC.ArrayFromElements("a", VC.Boolean(true)),
@@ -883,7 +884,7 @@ func reflectionEncoderTest(t *testing.T) {
883884
EC.Null("w"),
884885
EC.Array("x", NewArray()),
885886
EC.ArrayFromElements("y", VC.Document(NewDocument())),
886-
EC.DateTime("z", time.Now().UnixNano()/int64(time.Millisecond)),
887+
EC.DateTime("z", now.UnixNano()/int64(time.Millisecond)),
887888
)),
888889
nil,
889890
},

0 commit comments

Comments
 (0)