Render a repeat iteration in no group, refuse a group that names nothing, key group names by category, and own reference overlap in one fence
Tests / vet + fmt + tests (pull_request) Successful in 1m6s

This commit is contained in:
2026-09-15 23:31:48 +02:00
parent f6b8f4fb50
commit d3f430bf53
9 changed files with 203 additions and 106 deletions
+4 -4
View File
@@ -72,7 +72,7 @@ func render(s *session, n node, sc drawScope) string {
if i > 0 {
b.WriteString(n.separator)
}
b.WriteString(expandAnew(s, n, sc.group))
b.WriteString(expandAnew(s, n))
}
return b.String()
default:
@@ -80,13 +80,13 @@ func render(s *session, n node, sc drawScope) string {
}
}
// expandAnew expands one repeat iteration of t as a render of its own, in group. Inlined into
// expandAnew expands one repeat iteration of t as a render of its own, in no group. Inlined into
// render's loop, its draw set would move to the heap.
//
//go:noinline
func expandAnew(s *session, t *template, group string) string {
func expandAnew(s *session, t *template) string {
var set drawSet
return expand(s, t, drawScope{set: &set, group: group})
return expand(s, t, drawScope{set: &set})
}
// pick selects one item. Uniform choices are O(1); weighted choices are an