From 7d6184cf4f58138485790b3d33830f412b876596 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 24 Sep 2024 15:01:25 +0200 Subject: [PATCH] ignore all non-JSON files within configs directory --- util/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/config.go b/util/config.go index a701582..aa40b2b 100644 --- a/util/config.go +++ b/util/config.go @@ -14,7 +14,10 @@ func ReadConfigs(cfgPath string) ([]*Config, error) { var configs []*Config err := filepath.Walk(cfgPath, func(path string, info fs.FileInfo, err error) error { - if info.IsDir() || strings.HasSuffix(info.Name(), ".example.json") { + name := info.Name() + isExample := strings.HasSuffix(name, ".example.json") + notJson := !strings.HasSuffix(name, ".json") + if info.IsDir() || isExample || notJson { return nil }