fix: most of the template blocks

This commit is contained in:
Max Richter
2025-09-30 19:28:56 +02:00
parent d35f3e5e2e
commit 2a1572f99d
20 changed files with 210 additions and 187 deletions

View File

@@ -18,11 +18,11 @@ type yamlBlock struct {
}
type yamlField struct {
Path string `yaml:"path"`
Value any `yaml:"value,omitempty"`
Codec string `yaml:"codec"`
Hidden bool `yaml:"hidden,omitempty"`
PathAlias []string `yaml:"pathAlias,omitempty"`
Path string `yaml:"path"`
Value any `yaml:"value,omitempty"`
Codec string `yaml:"codec"`
Hidden bool `yaml:"hidden,omitempty"`
PathAlias string `yaml:"pathAlias,omitempty"`
}
func parseYamlTemplate(input Slice) (block Block, err error) {
@@ -34,7 +34,7 @@ func parseYamlTemplate(input Slice) (block Block, err error) {
dec.KnownFields(true)
if err := dec.Decode(&blk); err != nil {
return block, NewErrorf("content '%q' -> %w", cleaned, err).WithPosition(input.start, input.end)
return block, NewErrorf("failed to parse yaml -> %w", err).WithPosition(input.start, input.end)
}
if blk.Path == "" {