23
}
24
26
>
// If you see this warning, it means that a default value used in New*TypedSetting has a
27
>
// non-nil slice or map in it. That can lead to confusing behavior since the value from
28
>
// dynamic config will be merged over the default value (e.g. the slice will be appended
29
>
// to, not replaced). If that behavior is desired, you can avoid this warning by using
30
>
// New*TypedSettingWithConverter and referring to dynamicconfig.ConvertStructure
31
>
// explicitly. Otherwise use nil slices and maps, including at the top level
32
>
// (so `[]string(nil)` instead of `[]string{}`).
33
>
logSharedStructureWarningsOnce.Do(func() {
34
>
sharedStructureWarnings.Range(func(key, path any) bool {
35
softassert.Fail(logger,
36
"default value contains shared structure",