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

Method InConfig

viper.go:1467–1475  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

1465func InConfig(key string) bool { return v.InConfig(key) }
1466
1467func (v *Viper) InConfig(key string) bool {
1468 lcaseKey := strings.ToLower(key)
1469
1470 // if the requested key is an alias, then return the proper key
1471 lcaseKey = v.realKey(lcaseKey)
1472 path := strings.Split(lcaseKey, v.keyDelim)
1473
1474 return v.searchIndexableWithPathPrefixes(v.config, path) != nil
1475}
1476
1477// SetDefault sets the default value for this key.
1478// SetDefault is case-insensitive for a key.

Callers 3

TestUnmarshalingFunction · 0.80
TestReadConfigFunction · 0.80
InConfigFunction · 0.80

Calls 2

realKeyMethod · 0.95

Tested by 2

TestUnmarshalingFunction · 0.64
TestReadConfigFunction · 0.64