Closed bersace closed 3 months ago
Thanks @bersace. Unsure if we should add these as util functions as they only take a couple of lines of code to implement. In the same vein, there may be many other niche util functions that'll then have to be considered. FindRecursively()
etc.
Implementing a Find functionality can be as simple as this for instance.
for _, f := range []string{"ldaprc", ".ldaprc", "ldap.conf"} {
if _, err := os.Stat(filename); err == nil {
k.Load(file.Provider(f), toml.Parser())
break
}
}
Hi,
Thanks for koanf, it's awesome.
I think it may be useful if
file
module provides a helper to find a file amongst candidate. e.g.And also finding a file in parent directory:
What do you think of this need ?
Regards, Étienne