pointer dereferencer

This commit is contained in:
Emery Hemingway 2013-09-29 18:47:01 -05:00
parent 4a82f2c581
commit 38878bfda9

View File

@ -13,7 +13,6 @@ import (
"errors"
"fmt"
"io"
"reflect"
"sort"
"strings"
@ -395,6 +394,10 @@ func writeValue(w io.Writer, val reflect.Value) (err error) {
return
}
for val.Kind() == reflect.Ptr || val.Kind() == reflect.Interface {
val = val.Elem()
}
switch v := val; v.Kind() {
case reflect.String:
s := v.String()