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

Duration constraints can only handle 64-bit compatible values #34

Closed
htuch opened this issue Nov 30, 2017 · 3 comments
Closed

Duration constraints can only handle 64-bit compatible values #34

htuch opened this issue Nov 30, 2017 · 3 comments
Labels
Bug Reports and/or fixes a bug Go Go language support

Comments

@htuch
Copy link
Contributor

htuch commented Nov 30, 2017

The Duration protos is capable of representing values > time.Duration, see https://github.com/golang/protobuf/blob/master/ptypes/duration.go#L73 and https://github.com/google/protobuf/blob/master/src/google/protobuf/util/time_util.h#L61. The Go (but not C++) templates and checker.go requires a conversion to time.Duration, which won't work for these large numbers.

@htuch
Copy link
Contributor Author

htuch commented Nov 30, 2017

Same will be true for Timestamp

@rodaine
Copy link
Member

rodaine commented Nov 30, 2017

time.Time is represented internally with seconds and nanos like the proto. That should work as intended for the timestamp. Duration will certainly need modification, however.

@htuch
Copy link
Contributor Author

htuch commented Nov 30, 2017

@rodaine yeah, but there is some common code in checker.go that might need addressing here. Worth adding a test for in any case.

@rodaine rodaine added Bug Reports and/or fixes a bug Go Go language support labels Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reports and/or fixes a bug Go Go language support
Projects
None yet
Development

No branches or pull requests

3 participants