mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-27 22:30:01 +08:00
Begin implementing error handling and re-handling
This commit is contained in:
6
caddy.go
6
caddy.go
@ -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 (
|
||||
|
Reference in New Issue
Block a user