(ctx context.Context, sv *Values)
| 135 | } |
| 136 | |
| 137 | func (d *DurationSetting) setToDefault(ctx context.Context, sv *Values) { |
| 138 | // See if the default value was overridden. |
| 139 | if val := sv.getDefaultOverride(d.slot); val != nil { |
| 140 | // As per the semantics of override, these values don't go through |
| 141 | // validation. |
| 142 | _ = d.set(ctx, sv, val.(time.Duration)) |
| 143 | return |
| 144 | } |
| 145 | if err := d.set(ctx, sv, d.defaultValue); err != nil { |
| 146 | panic(err) |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // RegisterDurationSetting defines a new setting with type duration. |
| 151 | func RegisterDurationSetting( |
nothing calls this directly
no test coverage detected