diff --git a/src/text/template/exec.go b/src/text/template/exec.go index 9f55527bb4..96d2f50ef8 100644 --- a/src/text/template/exec.go +++ b/src/text/template/exec.go @@ -363,9 +363,8 @@ func (s *state) walkRange(dot reflect.Value, r *parse.RangeNode) { oneIteration := func(index, elem reflect.Value) { if len(r.Pipe.Decl) > 0 { if r.Pipe.IsAssign { - // With two variables index comes first in all cases. - // With one variable, we use the element for most cases, - // but not for range over a function. + // With two variables, index comes first. + // With one, we use the element. if len(r.Pipe.Decl) > 1 { s.setVar(r.Pipe.Decl[0].Ident[0], index) } else {