improve package gcmd

This commit is contained in:
John Guo
2022-01-01 00:58:10 +08:00
parent 09f9d1cb7a
commit c1586a3b81
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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()