Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetFs useless when not using default Viper instance #404

Closed
progrium opened this issue Oct 24, 2017 · 0 comments
Closed

SetFs useless when not using default Viper instance #404

progrium opened this issue Oct 24, 2017 · 0 comments

Comments

@progrium
Copy link
Contributor

progrium commented Oct 24, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant