CloneForRuntime returns an independent in-memory snapshot of the full config.
()
| 11 | |
| 12 | // CloneForRuntime returns an independent in-memory snapshot of the full config. |
| 13 | func (cfg *Config) CloneForRuntime() *Config { |
| 14 | if cfg == nil { |
| 15 | return nil |
| 16 | } |
| 17 | cloned := cloneRuntimeValue(reflect.ValueOf(cfg)) |
| 18 | return cloned.Interface().(*Config) |
| 19 | } |
| 20 | |
| 21 | func cloneRuntimeValue(v reflect.Value) reflect.Value { |
| 22 | if !v.IsValid() { |