MCPcopy
hub / github.com/spf13/viper / MergeConfig

Method MergeConfig

viper.go:1588–1596  ·  view source on GitHub ↗
(in io.Reader)

Source from the content-addressed store, hash-verified

1586func MergeConfig(in io.Reader) error { return v.MergeConfig(in) }
1587
1588func (v *Viper) MergeConfig(in io.Reader) error {
1589 config := make(map[string]any)
1590
1591 if err := v.unmarshalReader(in, config); err != nil {
1592 return err
1593 }
1594
1595 return v.MergeConfigMap(config)
1596}
1597
1598// MergeConfigMap merges the configuration from the map given with an existing config.
1599// Note that the map given may be modified.

Callers 5

MergeInConfigMethod · 0.95
TestMergeConfigFunction · 0.80
MergeConfigFunction · 0.80

Calls 2

unmarshalReaderMethod · 0.95
MergeConfigMapMethod · 0.95

Tested by 3

TestMergeConfigFunction · 0.64