Closed bboreham closed 6 years ago
Good catch. Missed a push to include (En|De)codeTime in codecgen. Will include that.
Beyond that, msgpack spec now specifies how to encode/decode time. So we MUST support it. If you want to do something else, I suggest that you create a custom type (even if it just wraps time.Time) and define MarshalBinary on that, and that will be used.
I will push a fix for (En|De)codeTime support in codecgen tomorrow.
The code generator is using Go's
MarshalBinary
whereas the non-code-generated version is using anEncodeTime
function introduced in debb8e2d2e8bd8cf1e9b6d806cf5e58df86b970c.(The
EncodeTime
version has advantages but I need to be able to handle data encoded with theMarshalBinary
version.)Slightly stupid repro but I couldn't figure out how to encode with one scheme and decode with the other so I just hard-coded the encoding of one into the test:
timecheck.go
:timecheck_test.go
:Test without codecgen:
Now with codecgen: