From bab97b4ec342d84baa93cc7583d4d2c5eaac85b4 Mon Sep 17 00:00:00 2001 From: Daniel Einspanjer Date: Wed, 25 Jul 2018 09:34:48 -0400 Subject: [PATCH] Add a note in the README.md for usage of CancelWatchConfig() --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d752822..69d3aba 100644 --- a/README.md +++ b/README.md @@ -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 Viper predefines many configuration sources such as files, environment