News for hackers. Stuff that matters.
Re:Please put units in names by chrismorgan on Tuesday March 22, 2022 @05:53AM (#30764322)
You’re looking at this from the application perspective, where with the specific example of durations constant multiplication is certainly far, far more common. But you’re discounting library concerns, where it would not be out of the ordinary to receive a time.Duration and an int64 from parameters or a struct or similar.

This is also pretty typical of the trade-offs Go makes: it focuses on making things nice for the application writer, mostly pretty successfully, but at the regular cost of pain and with serious typing compromises for the library writer.

There are no comments on this comment yet.