1
0
mirror of https://github.com/golang/go synced 2024-11-14 17:30:29 -07:00

text/template: use correct verbs for reflect.Value

Fixes #69708.

Change-Id: I8d7d10df4eed36cc76413d0645d89fe6e16f3296
This commit is contained in:
Jes Cok 2024-09-30 22:45:33 +08:00
parent 7fd0b133dc
commit fcc15513e4

View File

@ -398,7 +398,7 @@ func (s *state) walkRange(dot reflect.Value, r *parse.RangeNode) {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
if len(r.Pipe.Decl) > 1 {
s.errorf("can't use %s to iterate over more than one variable", val)
s.errorf("can't use %v to iterate over more than one variable", val)
break
}
run := false
@ -453,7 +453,7 @@ func (s *state) walkRange(dot reflect.Value, r *parse.RangeNode) {
case reflect.Func:
if val.Type().CanSeq() {
if len(r.Pipe.Decl) > 1 {
s.errorf("can't use %s iterate over more than one variable", val)
s.errorf("can't use %v iterate over more than one variable", val)
break
}
run := false