conf
conf copied to clipboard
behavior with maps
I guess I expected based on the Map abstraction that you could deserialize config into either a map or a struct. One of the first tests I wrote did this:
source := NewKubernetesConfigMapSource("./testdata/configmap")
base := make(map[string]string)
mp := makeNodeMap(reflect.ValueOf(base), reflect.TypeOf(base))
if err := source.Load(mp); err != nil {
t.Fatal(err)
}
Which "worked" but produces a panic if you try Loader.Load.
We should maybe try to make more clear that you should only be passing structs, maybe by also panicking further down.