Skip to content

time: ParseDuration fails to parse values consisting of multiple zeros #14209

@iand

Description

@iand

time.ParseDuration returns an error when passed a string consisting of more than one zero but no unit: "time: missing unit in duration 00"

See http://play.golang.org/p/_UklkYQ0I1

I'd expect this to have the same behaviour as parsing a single zero, i.e. return a duration of 0 and no error. Leading zeros are ignored as expected when the supplied string has a unit.

go version go1.5.2 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions