@@ -54,7 +54,7 @@ const (
5454// your application. Use the config.Duration type to support automatic unmarshal
5555// from all sources. If you do not use a config file, do not use this type because
5656// the environment unmarshaler supports time.Duration natively.
57- type Duration struct { time.Duration }
57+ type Duration struct { time.Duration } //nolint:recvcheck // pointer receiver and non-pointer receiver is on purpose.
5858
5959// UnmarshalText parses a duration type from a config file. This method works
6060// with the Duration type to allow unmarshaling of durations from files and
@@ -71,17 +71,17 @@ func (d *Duration) UnmarshalText(b []byte) error {
7171}
7272
7373// MarshalText returns the string representation of a Duration. ie. 1m32s.
74- func (d * Duration ) MarshalText () ([]byte , error ) {
75- return []byte (d .Duration . String ()), nil
74+ func (d Duration ) MarshalText () ([]byte , error ) {
75+ return []byte (d .String ()), nil
7676}
7777
7878// MarshalJSON returns the string representation of a Duration for JSON. ie. "1m32s".
79- func (d * Duration ) MarshalJSON () ([]byte , error ) {
80- return []byte (`"` + d .Duration . String () + `"` ), nil
79+ func (d Duration ) MarshalJSON () ([]byte , error ) {
80+ return []byte (`"` + d .String () + `"` ), nil
8181}
8282
8383// String returns a Duration as string without trailing zero units.
84- func (d * Duration ) String () string {
84+ func (d Duration ) String () string {
8585 dur := d .Duration .String ()
8686 if len (dur ) > 3 && dur [len (dur )- 3 :] == "m0s" {
8787 dur = dur [:len (dur )- 2 ]
0 commit comments