Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
time: ParseDuration fails for large strings #15011
Please answer these questions before submitting your issue. Thanks!
From what i remember when changing ParseDuration it does not use infinite precision math:
Hi, thanks for checking this.
I understand that there is no benefit in using so many digits. I found the issue because I was parsing the duration as I got it from somewhere else and this string came.
However, it seems that this case also fails, but it is a valid time inside precision (59 seconds and one nanosecond, expressed in hours): http://play.golang.org/p/xCp_XyTxXC. If you start removing the last digits, you get 59s, not 59s1ns. You can get 59s1ns if you round it by hand (http://play.golang.org/p/kD8r2ShnNB). I don't know if these cases should be managed by ParseDuration (and Parse may have the same issue).