Skip to content

Commit

Permalink
update type comments
Browse files Browse the repository at this point in the history
  • Loading branch information
r.khavronenko committed Dec 11, 2017
1 parent 2abb88a commit 2cfb52d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil
}

// String implements the Stringer interface.
func (d Duration) String() string {
factors := map[string]time.Duration{
"w": time.Hour * 24 * 7,
Expand Down Expand Up @@ -180,8 +181,8 @@ func (d Duration) MarshalYAML() (interface{}, error) {
// borrowed from github.com/prometheus/prometheus
var durationRE = regexp.MustCompile("^([0-9]+)(w|d|h|m|s|ms|µs|ns)$")

// StringToDuration parses a string into a time.Duration, assuming that a year
// always has 365d, a week always has 7d, and a day always has 24h.
// StringToDuration parses a string into a time.Duration,
// assuming that a week always has 7d, and a day always has 24h.
func parseDuration(durationStr string) (Duration, error) {
matches := durationRE.FindStringSubmatch(durationStr)
if len(matches) != 3 {
Expand Down

0 comments on commit 2cfb52d

Please sign in to comment.