@@ -15,19 +15,12 @@ type WshRpcMethodDecl struct {
1515 Command string
1616 CommandType string
1717 MethodName string
18- CommandDataType reflect.Type
1918 CommandDataTypes []reflect.Type
2019 DefaultResponseDataType reflect.Type
2120}
2221
2322func (decl * WshRpcMethodDecl ) GetCommandDataTypes () []reflect.Type {
24- if len (decl .CommandDataTypes ) > 0 {
25- return decl .CommandDataTypes
26- }
27- if decl .CommandDataType != nil {
28- return []reflect.Type {decl .CommandDataType }
29- }
30- return nil
23+ return decl .CommandDataTypes
3124}
3225
3326var contextRType = reflect .TypeOf ((* context .Context )(nil )).Elem ()
@@ -86,15 +79,10 @@ func generateWshCommandDecl(method reflect.Method) *WshRpcMethodDecl {
8679 decl .Command = strings .ToLower (cmdStr )
8780 decl .CommandType = getWshCommandType (method )
8881 decl .MethodName = method .Name
89- var cdataType reflect.Type
9082 var cdataTypes []reflect.Type
91- if method .Type .NumIn () > 1 {
92- cdataType = method .Type .In (1 )
93- }
9483 for idx := 1 ; idx < method .Type .NumIn (); idx ++ {
9584 cdataTypes = append (cdataTypes , method .Type .In (idx ))
9685 }
97- decl .CommandDataType = cdataType
9886 decl .CommandDataTypes = cdataTypes
9987 decl .DefaultResponseDataType = getWshMethodResponseType (decl .CommandType , method )
10088 return decl
0 commit comments