slog.Error arg err should be a string or a slog.Attr

This commit is contained in:
rafaelDev0ps 2024-11-11 10:09:18 -03:00
parent b3834bf559
commit 45d1b52146

View file

@ -1,17 +1,18 @@
package main
import (
"github.com/fsnotify/fsnotify"
"github.com/google/uuid"
"github.com/maddalax/htmgo/cli/htmgo/internal"
"github.com/maddalax/htmgo/cli/htmgo/internal/dirutil"
"github.com/maddalax/htmgo/cli/htmgo/tasks/module"
"log"
"log/slog"
"os"
"path/filepath"
"strings"
"time"
"github.com/fsnotify/fsnotify"
"github.com/google/uuid"
"github.com/maddalax/htmgo/cli/htmgo/internal"
"github.com/maddalax/htmgo/cli/htmgo/internal/dirutil"
"github.com/maddalax/htmgo/cli/htmgo/tasks/module"
)
func startWatcher(cb func(version string, file []*fsnotify.Event)) {
@ -118,7 +119,7 @@ func startWatcher(cb func(version string, file []*fsnotify.Event)) {
if info.IsDir() {
err = watcher.Add(path)
if err != nil {
slog.Error("Error adding directory to watcher:", err)
slog.Error("Error adding directory to watcher:", err.Error())
} else {
slog.Debug("Watching directory:", slog.String("path", path))
}