Decode: allow maximum seconds value of 60 (#700)
RFC3339 allows seconds to be 60 when adding leap seconds
This commit is contained in:
@@ -224,8 +224,8 @@ func parseLocalTime(b []byte) (LocalTime, []byte, error) {
|
||||
return t, nil, err
|
||||
}
|
||||
|
||||
if t.Second > 59 {
|
||||
return t, nil, newDecodeError(b[6:8], "seconds cannot be greater 59")
|
||||
if t.Second > 60 {
|
||||
return t, nil, newDecodeError(b[6:8], "seconds cannot be greater 60")
|
||||
}
|
||||
|
||||
b = b[8:]
|
||||
|
||||
+1
-1
@@ -2424,7 +2424,7 @@ world'`,
|
||||
{
|
||||
desc: "invalid seconds value",
|
||||
data: `a=1979-05-27T12:45:99`,
|
||||
msg: `seconds cannot be greater 59`,
|
||||
msg: `seconds cannot be greater 60`,
|
||||
},
|
||||
{
|
||||
desc: `binary with invalid digit`,
|
||||
|
||||
Reference in New Issue
Block a user