Skip to content

Commit a24a9fe

Browse files
committed
Recognize RFC3339 dates when ending in Z instead of +HH:DD.
1 parent e5931b7 commit a24a9fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

json-to-go.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function jsonToGo(json, typename)
119119
switch (typeof val)
120120
{
121121
case "string":
122-
if (/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\+\d\d:\d\d/.test(val))
122+
if (/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\+\d\d:\d\d|Z)/.test(val))
123123
return "time.Time";
124124
else
125125
return "string";

0 commit comments

Comments
 (0)