diff --git a/os/gcmd/gcmd_command_object.go b/os/gcmd/gcmd_command_object.go index 4948741c7..af03f6628 100644 --- a/os/gcmd/gcmd_command_object.go +++ b/os/gcmd/gcmd_command_object.go @@ -70,9 +70,9 @@ func NewFromObject(object interface{}) (rootCmd *Command, err error) { if rootCommandName == "" { rootCommandName = rootCmd.Name } - for i := 0; i < originValueAndKind.InputValue.NumMethod(); i++ { + for i := 0; i < reflectValue.NumMethod(); i++ { var ( - method = originValueAndKind.InputValue.Method(i) + method = reflectValue.Method(i) methodCmd *Command ) methodCmd, err = newCommandFromMethod(object, method) diff --git a/os/gcmd/gcmd_z_unit_feature_object1_test.go b/os/gcmd/gcmd_z_unit_feature_object1_test.go index 901062d74..b799a3126 100644 --- a/os/gcmd/gcmd_z_unit_feature_object1_test.go +++ b/os/gcmd/gcmd_z_unit_feature_object1_test.go @@ -243,7 +243,7 @@ func Test_Command_Pointer(t *testing.T) { t.AssertNil(err) t.Assert(value, `{"Content":"john"}`) }) - + return gtest.C(t, func(t *gtest.T) { var ( ctx = gctx.New()