From fbc4c583a4e2759d6b8cdbb98de2c769918ddac8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 May 2024 18:18:59 +0200 Subject: docs: embed defaults in app --- import/main.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'import') diff --git a/import/main.go b/import/main.go index de652c5..1e6b87d 100644 --- a/import/main.go +++ b/import/main.go @@ -11,7 +11,6 @@ import ( "searchix/internal/config" "searchix/internal/importer" "searchix/internal/search" - "slices" "strings" "time" ) @@ -27,11 +26,7 @@ func main() { log.Fatal(err) } - enabledSources := slices.DeleteFunc(cfg.Sources, func(s importer.Source) bool { - return !s.Enable - }) - - if len(enabledSources) == 0 { + if len(cfg.Sources) == 0 { slog.Info("No sources enabled") return @@ -47,8 +42,8 @@ func main() { var imp importer.Importer var hadErrors bool - for _, source := range enabledSources { - logger := slog.With("name", source.Name, "importer", source.Type.String()) + for name, source := range cfg.Sources { + logger := slog.With("name", name, "importer", source.Type.String()) logger.Debug("starting importer") switch source.Type { -- cgit 1.4.1