1
0
mirror of https://github.com/golang/go synced 2024-10-03 08:21:21 -06:00

go/printer: use new reflect interface (CL 31107)

R=gri
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=31115
CL=31285
This commit is contained in:
Russ Cox 2009-07-07 11:04:10 -07:00
parent b9b32cab58
commit 65dbe76532

View File

@ -152,8 +152,8 @@ func (p *printer) adjustSpacingAndMergeComments() {
func (p *printer) print(args ...) {
v := reflect.NewValue(args).(reflect.StructValue);
for i := 0; i < v.Len(); i++ {
v := reflect.NewValue(args).(*reflect.StructValue);
for i := 0; i < v.NumField(); i++ {
p.adjustSpacingAndMergeComments();
f := v.Field(i);
switch x := f.Interface().(type) {