We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 686e0ad commit 393ac0dCopy full SHA for 393ac0d
lib/proto/a_interface_test.go
@@ -5,6 +5,7 @@ import (
5
"encoding/json"
6
"errors"
7
"reflect"
8
+ "time"
9
10
"github.com/go-rod/rod/lib/proto"
11
"github.com/go-rod/rod/lib/utils"
@@ -73,6 +74,10 @@ func (t T) TimeCodec() {
73
74
data, err = json.Marshal(datetime)
75
t.E(err)
76
t.Eq(raw, data)
77
+
78
+ var sessionExpires proto.TimeSinceEpoch = -1
79
+ var zeroTime time.Time
80
+ t.Eq(sessionExpires.Time(), zeroTime)
81
}
82
83
func (t T) Rect() {
lib/proto/a_patch.go
@@ -16,6 +16,9 @@ type TimeSinceEpoch float64
16
17
// Time interface.
18
func (t TimeSinceEpoch) Time() time.Time {
19
+ if t == -1 {
20
+ return time.Time{}
21
+ }
22
return (time.Unix(0, 0)).Add(
23
time.Duration(t * TimeSinceEpoch(time.Second)),
24
)
0 commit comments