From 1d8d980bc8d978b12280f734d970a6371ab787e6 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Tue, 3 Oct 2023 00:17:04 +0700 Subject: [PATCH] fix: nil pointer of `run.watcher.{config,datasets}.Events` Signed-off-by: Dwi Siswanto --- internal/runner/runner.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/runner/runner.go b/internal/runner/runner.go index ed803ba..9d71787 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -51,6 +51,8 @@ func New(opt *common.Options) error { defer w.Close() run.watcher.config = w + } else { + run.watcher.config = new(fsnotify.Watcher) } dest := buildDest(opt.Destination) @@ -94,6 +96,8 @@ func New(opt *common.Options) error { if err := run.cron(); err != nil { opt.Logger.Fatal(errSomething, "err", err) } + } else { + run.watcher.datasets = new(fsnotify.Watcher) } go func() {