vendor/github.com/spf13/viper/viper_go1_16.go
changeset 260 445e01aede7e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/github.com/spf13/viper/viper_go1_16.go	Tue Aug 23 22:39:43 2022 +0200
@@ -0,0 +1,32 @@
+//go:build go1.16 && finder
+// +build go1.16,finder
+
+package viper
+
+import (
+	"fmt"
+
+	"github.com/spf13/afero"
+)
+
+// Search all configPaths for any config file.
+// Returns the first path that exists (and is a config file).
+func (v *Viper) findConfigFile() (string, error) {
+	finder := finder{
+		paths:            v.configPaths,
+		fileNames:        []string{v.configName},
+		extensions:       SupportedExts,
+		withoutExtension: v.configType != "",
+	}
+
+	file, err := finder.Find(afero.NewIOFS(v.fs))
+	if err != nil {
+		return "", err
+	}
+
+	if file == "" {
+		return "", ConfigFileNotFoundError{v.configName, fmt.Sprintf("%s", v.configPaths)}
+	}
+
+	return file, nil
+}