Begin implementing error handling and re-handling

This commit is contained in:
Matthew Holt
2019-04-11 20:42:55 -06:00
parent d42529348f
commit 545f28008e
6 changed files with 282 additions and 85 deletions

View File

@ -161,10 +161,8 @@ func (d *Duration) UnmarshalJSON(b []byte) error {
return nil
}
// MarshalJSON satisfies json.Marshaler.
func (d Duration) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, time.Duration(d).String())), nil
}
// CtxKey is a value type for use with context.WithValue.
type CtxKey string
// currentCfg is the currently-loaded configuration.
var (