l := &Logic{} _, ok := reflect.TypeOf(l).MethodByName("Echo") if !ok { // check method 'Echo' exists log.Fatalf("instance method %s not exists!", "Echo") } // sm.Type.NumOut() // number of method return. // sm.Type.NumIn() // number of method arguments need. resp := reflect.ValueOf(l).MethodByName("Echo").Call([]reflect.Value{ // reflect invoke it reflect.ValueOf(&Query{ Id: 10, }), }) if !resp[0].IsNil() { // get result p := resp[0].Interface().(*Person) log.Printf("result[0]: %d, %s\n", p.Id, p.Name) } if !resp[1].IsNil() { // get result e := resp[1].Interface().(error) log.Printf("result[1]: %v\n", e) } }