On Wed, Sep 21, 2016 at 11:22 AM, Paul Jolly <p...@myitcv.org.uk> wrote: > Please can someone can enlighten me or point me towards relevant docs/other > regarding the design decisions behind time.Time? > > Specifically why the concept of an instant in time, referenced many times > throughout the time docs, was not encoded as a type itself: > > type Instant struct { > sec int64 > nsec int32 > } > > and time.Time then reference time.Instant in some way: > > type Time struct { > instant Instant > loc *Location > } > > The obvious difference being that an instant in time has no location. If I'm > only interested in instants in time (i.e. my code doesn't do anything > presentational) then the location is redundant.
I don't know if that was ever considered. I expect that part of the reasoning is that most operating systems don't give you a way to get an instant in time, separate from a location. They just tell you what time it is in the system timezone, time.Local. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.