Skip to content

Commit

Permalink
fix methods
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Sep 6, 2021
1 parent 9c9085f commit 2b99626
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ func (d *Duration) UnmarshalText(b []byte) (err error) {
}

// MarshalText returns the string representation of a Duration. ie. 1m32s.
func (d *Duration) MarshalText() ([]byte, error) {
func (d Duration) MarshalText() ([]byte, error) {
return []byte(d.Duration.String()), nil
}

// MarshalJSON returns the string representation of a Duration for JSON. ie. "1m32s".
func (d *Duration) MarshalJSON() ([]byte, error) {
func (d Duration) MarshalJSON() ([]byte, error) {
return []byte(`"` + d.Duration.String() + `"`), nil
}

Expand Down

0 comments on commit 2b99626

Please sign in to comment.