Add a note in the README.md for usage of CancelWatchConfig()

This commit is contained in:
Daniel Einspanjer 2018-07-25 09:34:48 -04:00
parent 981de21183
commit bab97b4ec3

View file

@ -123,6 +123,9 @@ viper.OnConfigChange(func(e fsnotify.Event) {
}) })
``` ```
If you wish to stop watching the configPaths, simply call viper.CancelWatchConfig().
Note: This might be necessary if your tests involve trying out various config files.
### Reading Config from io.Reader ### Reading Config from io.Reader
Viper predefines many configuration sources such as files, environment Viper predefines many configuration sources such as files, environment