time: error handling for time.Month.String() and time.Weekday.String() is inconsistent #24692
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
When converting a month out of range to String, the function returns a debug string, but panics for Weekday.
Code sample at https://play.golang.org/p/3U4gRY5kRzc
What did you expect to see?
Both should either panic, or return error string.
What did you see instead?
time.Month.String() returned debug string, time.Weekday.String() paniced.
The text was updated successfully, but these errors were encountered: