Decode: allow maximum seconds value of 60 (#700)

RFC3339 allows seconds to be 60 when adding leap seconds
This commit is contained in:
Cameron Moore
2021-12-05 19:00:42 -06:00
committed by GitHub
parent 6cd86876b8
commit b37e11d74d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
View File
@@ -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`,