-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.help wanted
Milestone
Description
See https://play.golang.org/p/z4GVpb8RQCY:
// time (underlying problem)
_, err := time.Parse(`"`+time.RFC3339+`"`, "0")
fmt.Println(err) // parsing time "0" as ""2006-01-02T15:04:05Z07:00"": cannot parse "0" as """
// encoding/json (how I encountered the error)
err = json.Unmarshal([]byte(`0`), new(time.Time))
fmt.Println(err) // parsing time "0" as ""2006-01-02T15:04:05Z07:00"": cannot parse "0" as """
The error message emitted by time.Parse contains unbalanced quotation marks, presumably because it uses its own trivial quote function to avoid a cycle-forming dependency on strconv. Ideally its quote function would be a little smarter. (Perhaps time.Parse could also avoid redundantly mentioning "parse" and "0" twice in the error message.)
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.help wanted