diff --git a/_examples/booktest/sqlite3/db.xo.go b/_examples/booktest/sqlite3/db.xo.go index 13bb81d9..541ffd9a 100644 --- a/_examples/booktest/sqlite3/db.xo.go +++ b/_examples/booktest/sqlite3/db.xo.go @@ -209,6 +209,16 @@ func (t *Time) Parse(s string) error { return ErrInvalidTime(s) } +// MarshalJSON satisfies the json.Marshaler interface. +func (t Time) MarshalJSON() ([]byte, error) { + return t.time.MarshalJSON() +} + +// UnmarshalJSON satisfies the json.Unmarshaler interface. +func (t *Time) UnmarshalJSON(data []byte) error { + return t.time.UnmarshalJSON(data) +} + // TimestampFormats are the timestamp formats used by SQLite3 database drivers // to store a time.Time in SQLite3. // diff --git a/templates/go/db.xo.go.tpl b/templates/go/db.xo.go.tpl index 37becff7..9e6040b4 100644 --- a/templates/go/db.xo.go.tpl +++ b/templates/go/db.xo.go.tpl @@ -206,6 +206,16 @@ func (t *Time) Parse(s string) error { return ErrInvalidTime(s) } +// MarshalJSON satisfies the json.Marshaler interface. +func (t Time) MarshalJSON() ([]byte, error) { + return t.time.MarshalJSON() +} + +// UnmarshalJSON satisfies the json.Unmarshaler interface. +func (t *Time) UnmarshalJSON(data []byte) error { + return t.time.UnmarshalJSON(data) +} + // TimestampFormats are the timestamp formats used by SQLite3 database drivers // to store a time.Time in SQLite3. //