Re:The type system is a programmer's best friend
by xigoi on Saturday November 05, 2022 @05:16PM
(#33485869)
The commenter you're replying to expressed it confusingly. The point is that in Go, 5 * time.Milliseconds(2500) is a type error, and instead you need to do time.Nanoseconds(5) * time.Milliseconds(2500).
[ Parent
| on HN ]
Re:The type system is a programmer's best friend
by morelisp on Saturday November 05, 2022 @05:39PM
(#33486109)
`5 * time.Milliseconds(2500)` is not a type error, though `int(5) * time.Milliseconds(2500)` is.
(This is especially relevant because you really mean `5 * (2500 * time.Millisecond)` vs. int(5) * (2500 * time.Millisecond)`, as there is no `time.Milliseconds` function.)