mirror of https://github.com/spf13/viper.git
call onConfigChange callback only if it is not nil, so i really become
an optional parameter.
This commit is contained in:
parent
15738813a0
commit
e919dff7ac
2
viper.go
2
viper.go
|
@ -289,9 +289,11 @@ func (v *Viper) WatchConfig() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("error:", err)
|
log.Println("error:", err)
|
||||||
}
|
}
|
||||||
|
if v.onConfigChange != nil {
|
||||||
v.onConfigChange(event)
|
v.onConfigChange(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
case err := <-watcher.Errors:
|
case err := <-watcher.Errors:
|
||||||
log.Println("error:", err)
|
log.Println("error:", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue