Report the canonical node path in load errors
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user