Delete the sort-order restatements on walkNodes and compileFields
This commit is contained in:
@@ -5,8 +5,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
// walkNodes calls fn once per contained node, passing the dot path that reaches it,
|
// walkNodes calls fn once per contained node, passing the dot path that reaches it.
|
||||||
// visiting keys in sorted order.
|
|
||||||
func walkNodes(root map[string]node, fn func(path string, n node) error) error {
|
func walkNodes(root map[string]node, fn func(path string, n node) error) error {
|
||||||
for _, name := range sortedNames(root) {
|
for _, name := range sortedNames(root) {
|
||||||
if err := eachNode(root[name], name, fn); err != nil {
|
if err := eachNode(root[name], name, fn); err != nil {
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ func readOptions(m map[string]any, pos position) (templateOptions, error) {
|
|||||||
return o, nil
|
return o, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// compileFields compiles every non-option key of a template object, in name order.
|
// compileFields compiles every non-option key of a template object.
|
||||||
func compileFields(m map[string]any, pos position) (map[string]node, error) {
|
func compileFields(m map[string]any, pos position) (map[string]node, error) {
|
||||||
fields := make(map[string]node, len(m))
|
fields := make(map[string]node, len(m))
|
||||||
keys := make([]string, 0, len(m))
|
keys := make([]string, 0, len(m))
|
||||||
|
|||||||
Reference in New Issue
Block a user