Merge pull request #9414 from ZhangShuaiyi/fix/tomlext_MarshalText

tomlext.Duration add MarshalText method
This commit is contained in:
Maksym Pavlenko
2023-12-01 22:36:53 +00:00
committed by GitHub

View File

@@ -29,6 +29,10 @@ func (d *Duration) UnmarshalText(b []byte) error {
return nil
}
func (d Duration) MarshalText() (text []byte, err error) {
return []byte(time.Duration(d).String()), nil
}
func ToStdTime(d Duration) time.Duration {
return time.Duration(d)
}