time.Time type value passed to Call.Return differs from value returned by the mocked interface.
I would expect the time.Time value passed to Call.Return to match exactly to the value returned by the mocked interface.
To Reproduce Steps to reproduce the behavior
run mockgen on source file
write test and do something like
transactionDate := time.Now()
fmt.Printf("Value passed to Call.Return(): %#v\n", transactionDate)
deps.clock.EXPECT().Now().Return(transactionDate)
Then on the next EXPECT call use the same transactionDate
set up test with new controller and mocked interface and run
Get an Unexpected call to error with the following
Got: {0 9.99 3 11 credit 2 3735928559 2999-01-02 00:00:00 +0000 UTC bob goto eleven 42 2021-07-05 15:19:49.711001449 -0500 CDT m=+0.013888202} (SomeType)
Want: is equal to {0 9.99 3 11 credit 2 3735928559 2999-01-02 00:00:00 +0000 UTC bob goto eleven 42 2021-07-05 15:19:49.710931843 -0500 CDT m=+0.013818600} (SomeType)
Also when I put in some prints I get this
Value passed to Call.Return(): time.Time{wall:0xc030f8396a5ff583, ext:13818600, loc:(*time.Location)(0x1b0fc20)}
Value returned from mocked interface: time.Time{wall:0xc030f8396a610569, ext:13888202, loc:(*time.Location)(0x1b0fc20)}
Additional Information
gomock mode (reflect or source): source
gomock version or git ref: v1.5.1-0.20210325190955-9336b7eccec0
time.Time
type value passed toCall.Return
differs from value returned by the mocked interface.I would expect the
time.Time
value passed toCall.Return
to match exactly to the value returned by the mocked interface.To Reproduce Steps to reproduce the behavior
transactionDate
Unexpected call to
error with the followingAlso when I put in some prints I get this
Additional Information
Triage Notes for the Maintainers