mirror of https://github.com/spf13/viper.git
New func GetConfigFilePath() which returns the path where Viper actually found the logfile
This commit is contained in:
parent
aafc9e6bc7
commit
48307d640f
9
viper.go
9
viper.go
|
@ -1734,6 +1734,15 @@ func (v *Viper) getConfigFile() (string, error) {
|
||||||
return v.getConfigFile()
|
return v.getConfigFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetConfigFilePath() (string, error) {
|
||||||
|
// Returns the path where Viper actually found the logfile it uses.
|
||||||
|
//
|
||||||
|
// Useful when you want to write the configPath to logfiles, stdout, etc.
|
||||||
|
// Comes in handy during debugging or when running in production environments.
|
||||||
|
cf, err := v.getConfigFile()
|
||||||
|
return cf, err
|
||||||
|
}
|
||||||
|
|
||||||
func (v *Viper) searchInPath(in string) (filename string) {
|
func (v *Viper) searchInPath(in string) (filename string) {
|
||||||
jww.DEBUG.Println("Searching for config in ", in)
|
jww.DEBUG.Println("Searching for config in ", in)
|
||||||
for _, ext := range SupportedExts {
|
for _, ext := range SupportedExts {
|
||||||
|
|
Loading…
Reference in New Issue