mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
improve package gcmd
This commit is contained in:
@ -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)
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user