diff --git a/fsnotify.go b/fsnotify.go index c51836df..a6ede71d 100644 --- a/fsnotify.go +++ b/fsnotify.go @@ -420,13 +420,15 @@ var debug = func() bool { return os.Getenv("FSNOTIFY_DEBUG") == "1" }() -var defaultOpts = WithOpts{ - bufsize: 65536, // 64K - op: Create | Write | Remove | Rename | Chmod, +func defaultOpts() WithOpts{ + return WithOpts { + bufsize: 65536, // 64K + op: Create | Write | Remove | Rename | Chmod, + } } func getOptions(opts ...AddOpt) WithOpts { - with := defaultOpts + with := defaultOpts() for _, o := range opts { if o != nil { o(&with)