unify-byte-counts #21
@@ -125,6 +125,10 @@ func (this *describer) describe(value reflect.Value) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
value = reflect.ValueOf(value.Interface())
|
value = reflect.ValueOf(value.Interface())
|
||||||
|
if !value.IsValid() {
|
||||||
|
this.printf("<invalid>")
|
||||||
|
return
|
||||||
|
}
|
||||||
switch value.Kind() {
|
switch value.Kind() {
|
||||||
case reflect.Array, reflect.Slice:
|
case reflect.Array, reflect.Slice:
|
||||||
this.printf("[\n")
|
this.printf("[\n")
|
||||||
@@ -155,7 +159,7 @@ func (this *describer) describe(value reflect.Value) {
|
|||||||
this.iprintf("\n")
|
this.iprintf("\n")
|
||||||
}
|
}
|
||||||
this.indent -= 1
|
this.indent -= 1
|
||||||
this.iprintf("}\n")
|
this.iprintf("}")
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
this.printf("map {\n")
|
this.printf("map {\n")
|
||||||
this.indent += 1
|
this.indent += 1
|
||||||
@@ -168,7 +172,7 @@ func (this *describer) describe(value reflect.Value) {
|
|||||||
this.iprintf("\n")
|
this.iprintf("\n")
|
||||||
}
|
}
|
||||||
this.indent -= 1
|
this.indent -= 1
|
||||||
this.iprintf("}\n")
|
this.iprintf("}")
|
||||||
case reflect.Pointer:
|
case reflect.Pointer:
|
||||||
this.printf("& ")
|
this.printf("& ")
|
||||||
this.describe(value.Elem())
|
this.describe(value.Elem())
|
||||||
|
|||||||
Reference in New Issue
Block a user