You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating an instance of Viper (such as writing tests), you can use SetFs to work with, say, an in-memory filesystem. However, Viper will not use it when looking up a configuration file. searchInPath uses a util.go function called exists that is hardcoded to the global v instance.
This can be fixed by simply letting exists take an instance of a filesystem to use.
The text was updated successfully, but these errors were encountered:
When creating an instance of Viper (such as writing tests), you can use SetFs to work with, say, an in-memory filesystem. However, Viper will not use it when looking up a configuration file.
searchInPath
uses autil.go
function calledexists
that is hardcoded to the globalv
instance.This can be fixed by simply letting
exists
take an instance of a filesystem to use.The text was updated successfully, but these errors were encountered: