From 4060de7351190c5e4c0832b46c1201f14e2e3779 Mon Sep 17 00:00:00 2001 From: Michael Sauter Date: Wed, 25 Oct 2023 09:44:38 +0200 Subject: [PATCH] Skip directories when collecting data --- cmd/render/render.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/render/render.go b/cmd/render/render.go index 671973a..b30417c 100644 --- a/cmd/render/render.go +++ b/cmd/render/render.go @@ -109,6 +109,14 @@ func collectDataFromMatchingFiles(baseDir, glob string, data map[string]interfac } defer f.Close() + fInfo, err := f.Stat() + if err != nil { + return err + } + if fInfo.IsDir() { + continue + } + dec := decoderFunc(f) err = dec.Decode(&fileData) if err != nil {