-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: add timepb support library #60
Conversation
Let's decide about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, I'm still not sure about the zero check but I see the docs make clear what "zero" means
@aaronc so maybe we should remove the |
I've added rapid tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just 1 nit
I'd say let's drop |
@@ -0,0 +1,3 @@ | |||
# timepb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README shows up in pkg.go.dev as well when you go to the package page. I think we need both. Will add doc.go
Co-authored-by: Aaron Craelius <aaron@regen.network>
Summary
Moved from: cosmos/cosmos-sdk#11085
A support library to do time operation with protobuf Timestamp
Motivation
With new proto directions we are going away from go stdlib
time.Time
to the protobuf Timestamppb package.We often do time operations (eg comparing times) and we need a canonical library for Timestamppb rather then repeating / copying code.
Updates
types/wellknown/time
. We are not creating a new types, but a support library, so I propose here different path:support/timepb
pbtime
, but it seams in protobuf they prefer to addpb
as a suffix.