now returns the session's current time, falling back to time.Now for sessions created without a clock (e.g. JSON deserialization).
()
| 1001 | // now returns the session's current time, falling back to time.Now for |
| 1002 | // sessions created without a clock (e.g. JSON deserialization). |
| 1003 | func (s *Session) now() time.Time { |
| 1004 | if s.clock != nil { |
| 1005 | return s.clock() |
| 1006 | } |
| 1007 | return time.Now() |
| 1008 | } |
| 1009 | |
| 1010 | // newID returns a fresh session ID using the session's generator, falling back |
| 1011 | // to a random UUID for sessions created without one. |