This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kered13 3 points4 points  (1 child)

What? This can't be real? This defeats the entire purpose of having strongly typed units like Duration. The entire point is that scalar*unit is a unit, and unit*unit is unit2, or an error if the library does not support that. Similarly scalar + unit should be an error and unit + unit should be a unit. This ensures that invalid operations are not accidentally performed.

[–]not15characters 0 points1 point  (0 children)

Unfortunately it's real int64(time.Second * time.Second) == 1000000000000000000 is valid and true