Skip to content

time: quote original text in error returned by ParseDuration #38295

Closed
@bruce-ricard

Description

@bruce-ricard

I am trying to parse some time strings using the standard library. I am trying to parse the time "for breakfast" (literally).

What did you expect to see?

I would expect to see an error message explaining clearly what I did wrong.

What did you see instead?

time: invalid duration for breakfast

That's not very helpful.

time: invalid duration "for breakfast"

would be highly more useful for debugging.

Please think of using quotation marks for quoted text when writing natural language like English.

This part of the code in particular, contains quite a few occurrences of quoted text without quotation marks.

I am happy to submit a PR if you agree this is a good change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions