[go-nuts] Re: OAuth2 token expiry logic

2020-04-22 Thread Ross Light
Round(0) ensures that the expiry is being compared to the wall clock time, since that's what the server uses to verify. If you're interested, you can look at https://golang.org/cl/83575, the commit that introduced this logic. -- You received this message because you are subscribed to the Googl

[go-nuts] Re: OAuth2 token expiry logic

2020-04-20 Thread Uli Kunitz
The code of the expired function ensure that only the wall time is used for comparisons. My guess is that they developers of the code wanted to avoid any confusion what times are compared. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un

Re: [go-nuts] Re: OAuth2 token expiry logic

2020-04-20 Thread ISE Development
On Monday, 20 April 2020 16:23:10 UTC+1, David Finkel wrote: > > > > On Mon, Apr 20, 2020 at 11:02 AM > wrote: > >> Whoops, you're right. I got my Time and Duration mixed up. Your question >> still stands, though. The section on Monotonic Clocks at >> https://pkg.go.dev/time?tab=doc is a bit dens

Re: [go-nuts] Re: OAuth2 token expiry logic

2020-04-20 Thread David Finkel
On Mon, Apr 20, 2020 at 11:02 AM wrote: > Whoops, you're right. I got my Time and Duration mixed up. Your question > still stands, though. The section on Monotonic Clocks at > https://pkg.go.dev/time?tab=doc is a bit dense, but my best guess is that > stripping the monotonic clock reading from th

[go-nuts] Re: OAuth2 token expiry logic

2020-04-20 Thread cratermoon
Whoops, you're right. I got my Time and Duration mixed up. Your question still stands, though. The section on Monotonic Clocks at https://pkg.go.dev/time?tab=doc is a bit dense, but my best guess is that stripping the monotonic clock reading from the Expiry ensures that the comparison is made a

[go-nuts] Re: OAuth2 token expiry logic

2020-04-20 Thread ISE Development
On Monday, 20 April 2020 15:04:54 UTC+1, crate...@gmail.com wrote: > > According to https://golang.org/pkg/time/#Duration.Round "If m <= 0, > Round returns d unchanged". So now I'm really curious, why do the Round() > at all? > But in this case, it's a time.Time value, so this applies ( https://

[go-nuts] Re: OAuth2 token expiry logic

2020-04-20 Thread cratermoon
According to https://golang.org/pkg/time/#Duration.Round "If m <= 0, Round returns d unchanged". So now I'm really curious, why do the Round() at all? s On Sunday, April 19, 2020 at 6:45:45 PM UTC-7, ise...@gmail.com wrote: > > Hi, > > I have been looking at various packages to understand how on