It's not clear this is actually the best way to handle time.Time, since there is a standard yaml format that may not match time.Time's, but having tests ensuring the current behavior is basically sane is a good idea nevertheless.
@@ -549,6 +549,10 @@ var unmarshalTests = []struct {
"a: 1.2.3.4\n",
map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
},
+ {
+ "a: 2015-02-24T15:19:39-03:00\n",
+ map[string]time.Time{"a": time.Unix(1424801979, 0)},
+ },
// Encode empty lists as zero-length slices.
{
@@ -295,6 +295,10 @@ var marshalTests = []struct {
// Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible).