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: misleading error message froms Parse for initial element missing leading zeroes #29918

Closed
tredoe opened this issue Jan 24, 2019 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@tredoe
Copy link

tredoe commented Jan 24, 2019

What version of Go are you using (go version)?

$ go version
go version go1.11.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Parsing the month-day "1-03" with layout "01-02".
https://play.golang.org/p/7bfuFfjG7nJ

What did you expect to see?

At the last part of the error i=1: cannot parse "1" as "01"

What did you see instead?

month out of range

@bcmills bcmills changed the title time: wrong error message at parsing months time: Parse error message is incorrect for initial month missing leading zero Jan 29, 2019
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 29, 2019
@bcmills bcmills added this to the Go1.13 milestone Jan 29, 2019
@bcmills bcmills changed the title time: Parse error message is incorrect for initial month missing leading zero time: misleading error message from Parse for initial month missing leading zero Jan 29, 2019
@bcmills bcmills changed the title time: misleading error message from Parse for initial month missing leading zero time: misleading error message froms Parse for initial element missing leading zeroes Jan 29, 2019
@gopherbot
Copy link

Change https://golang.org/cl/160338 mentions this issue: time: fix misleading error for leading zero format

@gopherbot
Copy link

Change https://golang.org/cl/160479 mentions this issue: time: fix parsing issue for improper month value

@gopherbot
Copy link

Change https://golang.org/cl/163260 mentions this issue: time: fix parse month error message

@dmitshur
Copy link
Contributor

It looks like there are 3 CLs open for review that are all trying to resolve this issue:

To make progress on this issue, those CLs should be reviewed.

@golang golang locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants