Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agree. Part of the problem here is that the Go time.Duration is just an int64 so you can do arithmetic on them. It would be better if there was something like NewDurationMilliseconds(). Thus the type here allowed me to shoot myself in the foot.

Having said that it doesn't change the fact that looking into the 'flaky' test was the right thing to do. Even if the type system were different I'm sure I would have shot myself in the foot in some other way.



Seems it would rather be better if there was a .net TimeSpan / JodaTime Duration type, or better yet, a type system that understood units.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: