Commit 67a7abad authored by Russ Cox's avatar Russ Cox

clear flags so that %+v does not pass the +

to the first field it prints.

R=r
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=21324
CL=21328
parent a10267ad
...@@ -386,7 +386,8 @@ func (p *P) printField(field reflect.Value) (was_string bool) { ...@@ -386,7 +386,8 @@ func (p *P) printField(field reflect.Value) (was_string bool) {
p.add('{'); p.add('{');
v := field.(reflect.StructValue); v := field.(reflect.StructValue);
t := v.Type().(reflect.StructType); t := v.Type().(reflect.StructType);
donames := p.fmt.plus; // first p.printField clears flag donames := p.fmt.plus;
p.fmt.clearflags(); // clear flags for p.printField
for i := 0; i < v.Len(); i++ { for i := 0; i < v.Len(); i++ {
if i > 0 { if i > 0 {
p.add(' ') p.add(' ')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment