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

Method findConfigFileOld

file.go:63–73  ·  view source on GitHub ↗

Search all configPaths for any config file. Returns the first path that exists (and is a config file).

()

Source from the content-addressed store, hash-verified

61// Search all configPaths for any config file.
62// Returns the first path that exists (and is a config file).
63func (v *Viper) findConfigFileOld() (string, error) {
64 v.logger.Info("searching for config in paths", "paths", v.configPaths)
65
66 for _, cp := range v.configPaths {
67 file := v.searchInPath(cp)
68 if file != "" {
69 return file, nil
70 }
71 }
72 return "", ConfigFileNotFoundError{v.configName, fmt.Sprintf("%s", v.configPaths)}
73}
74
75func (v *Viper) searchInPath(in string) (filename string) {
76 v.logger.Debug("searching for config in path", "path", in)

Callers 1

findConfigFileMethod · 0.95

Calls 1

searchInPathMethod · 0.95

Tested by

no test coverage detected