types: always use pointer on duration

This commit is contained in:
c9s 2022-12-24 20:39:01 +08:00
parent 4388bc209b
commit d27786d5ae
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -13,8 +13,8 @@ import (
type Duration time.Duration
func (d Duration) Duration() time.Duration {
return time.Duration(d)
func (d *Duration) Duration() time.Duration {
return time.Duration(*d)
}
func (d *Duration) UnmarshalJSON(data []byte) error {