// 见viper源码文件viper.gofunc(v *Viper)WatchConfig(){
…………
// we only care about the config file with the following cases:// 1 - if the config file was modified or created// 2 - if the real path to the config file changed (eg: k8s ConfigMap replacement)const writeOrCreateMask = fsnotify.Write | fsnotify.Create
if(filepath.Clean(event.Name)== configFile &&
event.Op&writeOrCreateMask !=0)||(currentConfigFile !=""&& currentConfigFile != realConfigFile){
…………
}
…………
}