Skip to content

Commit

Permalink
added second parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
deze333 committed Jan 6, 2015
1 parent 041104d commit b7f9ec4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion codec_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ func StringToDuration(val string) (dt time.Duration, err error) {
dt = time.Duration(num) * time.Hour
case "m":
dt = time.Duration(num) * time.Minute
case "s":
dt = time.Duration(num) * time.Second
default:
err = fmt.Errorf("Time duration must end with d/h/m: %v", val)
err = fmt.Errorf("Time duration must end with d/h/m/s: %v", val)
}
return
}
Expand Down

0 comments on commit b7f9ec4

Please sign in to comment.