From f03825671e87d60214d67407c457fb0f89d4c79d Mon Sep 17 00:00:00 2001 From: lilleman Date: Thu, 27 Aug 2026 23:25:53 +0200 Subject: [PATCH] Report the canonical node path in load errors --- fakes.go | 5 ++++- reference.go | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fakes.go b/fakes.go index 16ba3e7..2df1b57 100644 --- a/fakes.go +++ b/fakes.go @@ -114,8 +114,11 @@ func (f *Fakes) List() []string { } func join(prefix, name string) string { - if prefix == "" { + switch { + case prefix == "": return name + case name == "": + return prefix } return prefix + "." + name } diff --git a/reference.go b/reference.go index f658093..f3bd7fe 100644 --- a/reference.go +++ b/reference.go @@ -90,9 +90,14 @@ func contained(n node) []namedNode { } } +// named skips a bound {..path} key: it is a render edge, not containment, so using +// it as a path segment would report a node under a path that does not reach it. func named(m map[string]node) []namedNode { out := make([]namedNode, 0, len(m)) for _, name := range sortedNames(m) { + if isRef(name) { + continue + } out = append(out, namedNode{name: name, node: m[name]}) } return out