diff --git a/viper.go b/viper.go index 5f76cc0959..84c600fcb0 100644 --- a/viper.go +++ b/viper.go @@ -432,7 +432,7 @@ func (v *Viper) WatchConfig() { initWG := sync.WaitGroup{} initWG.Add(1) go func() { - watcher, err := newWatcher() + watcher, err := fsnotify.NewWatcher() if err != nil { log.Fatal(err) } diff --git a/watch.go b/watch.go deleted file mode 100644 index b5523b8f9d..0000000000 --- a/watch.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build !js -// +build !js - -package viper - -import "github.com/fsnotify/fsnotify" - -type watcher = fsnotify.Watcher - -func newWatcher() (*watcher, error) { - return fsnotify.NewWatcher() -} diff --git a/watch_wasm.go b/watch_wasm.go deleted file mode 100644 index 8e47e6a910..0000000000 --- a/watch_wasm.go +++ /dev/null @@ -1,30 +0,0 @@ -// +build js,wasm - -package viper - -import ( - "errors" - - "github.com/fsnotify/fsnotify" -) - -type watcher struct { - Events chan fsnotify.Event - Errors chan error -} - -func (*watcher) Close() error { - return nil -} - -func (*watcher) Add(name string) error { - return nil -} - -func (*watcher) Remove(name string) error { - return nil -} - -func newWatcher() (*watcher, error) { - return &watcher{}, errors.New("fsnotify is not supported on WASM") -}