github.com/fengjian1993/viper@v1.11.0/watch_wasm.go (about)

     1  // +build js,wasm
     2  
     3  package viper
     4  
     5  import (
     6  	"errors"
     7  
     8  	"github.com/fsnotify/fsnotify"
     9  )
    10  
    11  type watcher struct {
    12  	Events chan fsnotify.Event
    13  	Errors chan error
    14  }
    15  
    16  func (*watcher) Close() error {
    17  	return nil
    18  }
    19  
    20  func (*watcher) Add(name string) error {
    21  	return nil
    22  }
    23  
    24  func (*watcher) Remove(name string) error {
    25  	return nil
    26  }
    27  
    28  func newWatcher() (*watcher, error) {
    29  	return &watcher{}, errors.New("fsnotify is not supported on WASM")
    30  }