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

time: document the return value of time.Parse when parsing fails #23933

Closed
abbot opened this issue Feb 19, 2018 · 1 comment
Closed

time: document the return value of time.Parse when parsing fails #23933

abbot opened this issue Feb 19, 2018 · 1 comment
Labels
Documentation FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@abbot
Copy link

abbot commented Feb 19, 2018

Current implementation (as of this submission) of time.Parse always returns a zero time.Time{} value when it hits an error. It would be nice to document this and have it as a part of API, as it would simplify some use cases.

@ALTree ALTree changed the title Specify the return value of time.Parse when parsing fails time: document the return value of time.Parse when parsing fails Feb 19, 2018
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Feb 19, 2018
@ALTree ALTree added this to the Go1.11 milestone Feb 19, 2018
@ianlancetaylor
Copy link
Contributor

We aren't going to do that. While there are no plans to return a non-zero value, for an error case we only document the non-error result values where there is special reason to do so. There is no such reason here. You can write a trivial helper function to implement whatever functionality you want.

@golang golang locked and limited conversation to collaborators Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants