fix console help crash

This commit is contained in:
Radu Ioan Fericean
2016-01-26 16:37:58 +02:00
parent 09653b7826
commit b7d0637e15

View File

@@ -67,7 +67,10 @@ func (ce *CommandExecuter) clientArgs(iface interface{}) (args []string) {
for i := 0; i < typ.NumField(); i++ {
valField := val.Field(i)
typeField := typ.Field(i)
//log.Printf("%v (%v)", typeField.Name, valField.Kind())
//log.Printf("%v (%v : %v)", typeField.Name, valField.Kind(), typeField.PkgPath)
if len(typeField.PkgPath) > 0 { //unexported field
continue
}
switch valField.Kind() {
case reflect.Ptr, reflect.Struct:
if valField.Kind() == reflect.Ptr {
@@ -79,6 +82,7 @@ func (ce *CommandExecuter) clientArgs(iface interface{}) (args []string) {
}
}
args = append(args, ce.clientArgs(valField.Interface())...)
default:
args = append(args, typeField.Name)
}