Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "newtime" directive to use official msgpack time format #378

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

klauspost
Copy link
Collaborator

This adds msgp:newtime file directive that will encode all time fields using the -1 extension as defined in the (revised) messagepack spec

ReadTime/ReadTimeBytes will now support both types natively, and will accept either as input.

Extensions should remain unaffected.

Fixes #300

This adds `msgp:newtime` file directive that will encode all time fields using the -1 extension as defined in the [(revised) messagepack spec](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type)

ReadTime/ReadTimeBytes will now support both types natively, and will accept either as input.

Extensions should remain unaffected.

Fixes tinylib#300
msgp/write_bytes.go Outdated Show resolved Hide resolved
msgp/write.go Outdated Show resolved Hide resolved
@klauspost klauspost merged commit 4c71fd4 into tinylib:master Oct 30, 2024
4 checks passed
@klauspost klauspost deleted the add-official-timestamp branch October 30, 2024 08:42
@klauspost klauspost changed the title Add "newtime" directive to use official messagepack time format Add "newtime" directive to use official msgpack time format Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

time.Time is not follow the msgpack spec.
2 participants