Move List's path enumeration into list.go, position into node.go and sortedNames into sorted.go

This commit is contained in:
2026-10-07 02:08:38 +02:00
committed by Lillem4n
parent 6c8ddeb3ac
commit 63e985a53d
6 changed files with 126 additions and 118 deletions
-10
View File
@@ -3,7 +3,6 @@ package fejkdata
import (
"fmt"
"slices"
"sort"
"github.com/larvit/fejkdata/internal/invariant"
)
@@ -88,15 +87,6 @@ func namedNodes(m map[string]node) []namedNode {
return out
}
func sortedNames[V any](m map[string]V) []string {
names := make([]string, 0, len(m))
for name := range m {
names = append(names, name)
}
sort.Strings(names)
return names
}
// renderEdge is a child a node renders into, labelled by what reaches it (a field
// name, reference, or choice index) for a readable cycle report.
type renderEdge struct {