MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / setToDefault

Method setToDefault

pkg/settings/duration.go:137–148  ·  view source on GitHub ↗
(ctx context.Context, sv *Values)

Source from the content-addressed store, hash-verified

135}
136
137func (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.
151func RegisterDurationSetting(

Callers

nothing calls this directly

Calls 2

setMethod · 0.95
getDefaultOverrideMethod · 0.80

Tested by

no test coverage detected