Why does Golang get the units wrong when multiplying Durations

There have been spectacular accidents and incidents based on using the wrong unit - rockets that crashed, or the case of the “Gimli glider”. Yes, adding two values of different units can be a challenge. Wasn’t your initial complaint that Go does not handle units correctly?

Agreed, Duration could have been designed more closely to the “real world”. Again, this is not a problem of the core language and its type system but rather of the time package.

1 Like