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

Function initConfigs

viper_test.go:93–114  ·  view source on GitHub ↗
(v *Viper)

Source from the content-addressed store, hash-verified

91}`)
92
93func initConfigs(v *Viper) {
94 var r io.Reader
95 v.SetConfigType("yaml")
96 r = bytes.NewReader(yamlExample)
97 v.unmarshalReader(r, v.config)
98
99 v.SetConfigType("json")
100 r = bytes.NewReader(jsonExample)
101 v.unmarshalReader(r, v.config)
102
103 v.SetConfigType("toml")
104 r = bytes.NewReader(tomlExample)
105 v.unmarshalReader(r, v.config)
106
107 v.SetConfigType("env")
108 r = bytes.NewReader(dotenvExample)
109 v.unmarshalReader(r, v.config)
110
111 v.SetConfigType("json")
112 remote := bytes.NewReader(remoteExample)
113 v.unmarshalReader(remote, v.kvstore)
114}
115
116func initConfig(typ, config string, v *Viper) {
117 v.SetConfigType(typ)

Callers 3

TestAllKeysFunction · 0.85
TestBoundCaseSensitivityFunction · 0.85
TestFindsNestedKeysFunction · 0.85

Calls 2

SetConfigTypeMethod · 0.80
unmarshalReaderMethod · 0.80

Tested by

no test coverage detected