From b7d0637e156a6ffa6f1b33a22421a1aecfad346f Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 26 Jan 2016 16:37:58 +0200 Subject: [PATCH] fix console help crash --- console/command_executer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/console/command_executer.go b/console/command_executer.go index bf836da45..27d0ded67 100644 --- a/console/command_executer.go +++ b/console/command_executer.go @@ -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) }