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

Function NewWithOptions

viper.go:273–281  ·  viper.go::NewWithOptions

NewWithOptions creates a new Viper instance.

(opts ...Option)

Source from the content-addressed store, hash-verified

271
272// NewWithOptions creates a new Viper instance.
273func NewWithOptions(opts ...Option) *Viper {
274 v := New()
275
276 for _, opt := range opts {
277 opt.apply(v)
278 }
279
280 return v
281}
282
283// SetOptions sets the options on the global Viper instance.
284//

Callers 9

ExampleFinderFunction · 0.92
ExampleFindersFunction · 0.92
TestGetConfigFileFunction · 0.85
TestReadInConfigFunction · 0.85
TestEnvKeyReplacerFunction · 0.85
TestSubWithKeyDelimiterFunction · 0.85
TestKeyDelimiterFunction · 0.85

Calls 2

NewFunction · 0.85
applyMethod · 0.65

Tested by 9

ExampleFinderFunction · 0.74
ExampleFindersFunction · 0.74
TestGetConfigFileFunction · 0.68
TestReadInConfigFunction · 0.68
TestEnvKeyReplacerFunction · 0.68
TestSubWithKeyDelimiterFunction · 0.68
TestKeyDelimiterFunction · 0.68