Skip to content

DateTime and the different zero values used. #148

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

Merged
merged 2 commits into from
Mar 14, 2025

Conversation

fredbi
Copy link
Member

@fredbi fredbi commented Mar 13, 2025

@fredbi fredbi requested review from casualjim and youyuanwu March 13, 2025 20:14
@fredbi fredbi force-pushed the fix-141-NewDateTime branch 2 times, most recently from b0787c9 to 8bf5233 Compare March 14, 2025 11:10
@fredbi fredbi force-pushed the fix-141-NewDateTime branch from 8bf5233 to 4d289ef Compare March 14, 2025 18:29
@fredbi
Copy link
Member Author

fredbi commented Mar 14, 2025

Thank you @ccoVeille for your valuable comments. I've addressed your points.

fredbi added 2 commits March 14, 2025 19:38
* fixed the documentation for NewDateTime() to state explicitly that it does
  not yield the zero value. This value is checked against IsUNIXZero().
* introduced a new method MakeDateTime() for users who want a zero value
  that checks against IsZero().
* fixes go-openapi#141

Signed-off-by: Frederic BIDON <[email protected]>
Signed-off-by: Frederic BIDON <[email protected]>
@fredbi fredbi force-pushed the fix-141-NewDateTime branch from 4d289ef to 88198fb Compare March 14, 2025 18:38
@fredbi fredbi merged commit ad394bd into go-openapi:master Mar 14, 2025
9 checks passed
@fredbi fredbi deleted the fix-141-NewDateTime branch March 14, 2025 19:02
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.

NewDateTime returns a unix 0, but IsZero checks for zero time.Time
3 participants