()
| 2030 | } |
| 2031 | |
| 2032 | func (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 | |
| 2051 | func (v *Viper) getConfigFile() (string, error) { |
| 2052 | if v.configFile == "" { |
no test coverage detected