File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 55 "encoding/json"
66 "errors"
77 "reflect"
8+ "time"
89
910 "github.com/go-rod/rod/lib/proto"
1011 "github.com/go-rod/rod/lib/utils"
@@ -73,6 +74,10 @@ func (t T) TimeCodec() {
7374 data , err = json .Marshal (datetime )
7475 t .E (err )
7576 t .Eq (raw , data )
77+
78+ var sessionExpires proto.TimeSinceEpoch = - 1
79+ var zeroTime time.Time
80+ t .Eq (sessionExpires .Time (), zeroTime )
7681}
7782
7883func (t T ) Rect () {
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ type TimeSinceEpoch float64
1616
1717// Time interface.
1818func (t TimeSinceEpoch ) Time () time.Time {
19+ if t == - 1 {
20+ return time.Time {}
21+ }
1922 return (time .Unix (0 , 0 )).Add (
2023 time .Duration (t * TimeSinceEpoch (time .Second )),
2124 )
You can’t perform that action at this time.
0 commit comments