Always marshal timeduration as a string
This commit is contained in:
parent
3ff410c695
commit
d7221e15ac
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ func (t TimeDuration) MarshalJSON() ([]byte, error) {
|
|||
switch {
|
||||
case t.t.IsZero():
|
||||
if t.d == 0 {
|
||||
return []byte("null"), nil
|
||||
return []byte(`""`), nil
|
||||
}
|
||||
return json.Marshal(t.d.String())
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue