Skip to content

Commit 5182412

Browse files
Add DocBlock to WatchConfig (#1467)
* Add DocBlock to WatchConfig Added a small description of the WatchConfig(). So that you can understand in the ide why you could use it. * Update viper.go * update viper.go Signed-off-by: Mark Sagi-Kazar <[email protected]> Signed-off-by: Mark Sagi-Kazar <[email protected]> Co-authored-by: Márk Sági-Kazár <[email protected]> Co-authored-by: Mark Sagi-Kazar <[email protected]>
1 parent 0755477 commit 5182412

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

viper.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,18 @@ var SupportedExts = []string{"json", "toml", "yaml", "yml", "properties", "props
421421
// SupportedRemoteProviders are universally supported remote providers.
422422
var SupportedRemoteProviders = []string{"etcd", "etcd3", "consul", "firestore"}
423423

424+
// OnConfigChange sets the event handler that is called when a config file changes.
424425
func OnConfigChange(run func(in fsnotify.Event)) { v.OnConfigChange(run) }
426+
427+
// OnConfigChange sets the event handler that is called when a config file changes.
425428
func (v *Viper) OnConfigChange(run func(in fsnotify.Event)) {
426429
v.onConfigChange = run
427430
}
428431

432+
// WatchConfig starts watching a config file for changes.
429433
func WatchConfig() { v.WatchConfig() }
430434

435+
// WatchConfig starts watching a config file for changes.
431436
func (v *Viper) WatchConfig() {
432437
initWG := sync.WaitGroup{}
433438
initWG.Add(1)

0 commit comments

Comments
 (0)