From b59fd781d0a7a256f8015c84fac1d05aeec81a78 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Sun, 17 Nov 2024 18:24:00 +0000 Subject: [PATCH] (zilch lang go): fix go file parser with `all:` go:embed patterns Technically this isn't quite right, as the full list of files is not available to the go parser (some files are filtered out too early in the process), but it should do the job for now. --- lang/go/utils/parser/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/go/utils/parser/main.go b/lang/go/utils/parser/main.go index a6e4d9d..5190831 100644 --- a/lang/go/utils/parser/main.go +++ b/lang/go/utils/parser/main.go @@ -258,6 +258,8 @@ func main() { for _, pattern := range pkg.EmbedPatterns { matchedFiles := []string{} + storePattern := pattern + // TODO: proper matching if strings.HasPrefix(pattern, "all:") { pattern = pattern[4:] @@ -293,7 +295,7 @@ func main() { split = append(split, []string{match[len(dir)+1:], dirname, filepath.Base(match)}) } - out.Embeds[pattern] = split + out.Embeds[storePattern] = split } outfiles[dir] = out