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

Method getConfigType

viper.go:2032–2049  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2030}
2031
2032func (v *Viper) getConfigType() string {
2033 if v.configType != "" {
2034 return v.configType
2035 }
2036
2037 cf, err := v.getConfigFile()
2038 if err != nil {
2039 return ""
2040 }
2041
2042 ext := filepath.Ext(cf)
2043
2044 if len(ext) > 1 {
2045 return ext[1:]
2046 }
2047
2048 return ""
2049}
2050
2051func (v *Viper) getConfigFile() (string, error) {
2052 if v.configFile == "" {

Callers 4

ReadInConfigMethod · 0.95
MergeInConfigMethod · 0.95
WriteConfigToMethod · 0.95
unmarshalReaderMethod · 0.95

Calls 1

getConfigFileMethod · 0.95

Tested by

no test coverage detected