(argType reflect.Type, jsonArg any)
| 100 | } |
| 101 | |
| 102 | func convertWSCommand(argType reflect.Type, jsonArg any) (any, error) { |
| 103 | if _, ok := jsonArg.(map[string]any); !ok { |
| 104 | return nil, fmt.Errorf("cannot convert %T to %s", jsonArg, argType) |
| 105 | } |
| 106 | cmd, err := webcmd.ParseWSCommandMap(jsonArg.(map[string]any)) |
| 107 | if err != nil { |
| 108 | return nil, fmt.Errorf("error parsing command map: %w", err) |
| 109 | } |
| 110 | return cmd, nil |
| 111 | } |
| 112 | |
| 113 | func convertSpecial(argType reflect.Type, jsonArg any) (any, error) { |
| 114 | jsonType := reflect.TypeOf(jsonArg) |
no test coverage detected