From 5ebf615db5889a04738c555c651e07c1fd287748 Mon Sep 17 00:00:00 2001 From: qiulaidongfeng <2645477756@qq.com> Date: Thu, 19 Sep 2024 21:40:15 +0800 Subject: [PATCH] new Change-Id: I23ea3f7a59567f00dfb8b58d4bd067230fe94e13 --- src/text/template/exec.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 {