From 46e8b43591350f51279959290489592edcbf3b86 Mon Sep 17 00:00:00 2001 From: Jonathan Oliver Date: Tue, 7 Jan 2025 14:02:52 -0700 Subject: [PATCH] Extended interface. --- config.go | 5 +++-- interfaces.go | 1 + watcher.go | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 1410273..08b6a91 100644 --- a/config.go +++ b/config.go @@ -71,5 +71,6 @@ type nop struct{} func (nop) Printf(string, ...any) {} -func (nop) Listen() {} -func (nop) Close() error { return nil } +func (nop) Initialize() error { return nil } +func (nop) Listen() {} +func (nop) Close() error { return nil } diff --git a/interfaces.go b/interfaces.go index 3375b5e..475d1b9 100644 --- a/interfaces.go +++ b/interfaces.go @@ -3,6 +3,7 @@ package filewatcher import "io" type ListenCloser interface { + Initialize() error Listen() io.Closer } diff --git a/watcher.go b/watcher.go index e2ac8e7..07c0798 100644 --- a/watcher.go +++ b/watcher.go @@ -91,3 +91,5 @@ func (this *pollingWatcher) Close() error { this.shutdown() return nil } + +func (this *pollingWatcher) Initialize() error { return nil }