Better logging when a type is invalid during conversion

pull/6/head
Clayton Coleman 2014-11-06 22:00:10 -05:00
parent 9a998350f0
commit 9f15e96bd6
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ func EnforcePtr(obj interface{}) (reflect.Value, error) {
if v.Kind() == reflect.Invalid { if v.Kind() == reflect.Invalid {
return reflect.Value{}, fmt.Errorf("expected pointer, but got invalid kind") return reflect.Value{}, fmt.Errorf("expected pointer, but got invalid kind")
} }
return reflect.Value{}, fmt.Errorf("expected pointer, but got %v type", v.Type().Name()) return reflect.Value{}, fmt.Errorf("expected pointer, but got %v type", v.Type())
} }
if v.IsNil() { if v.IsNil() {
return reflect.Value{}, fmt.Errorf("expected pointer, but got nil") return reflect.Value{}, fmt.Errorf("expected pointer, but got nil")