MCPcopy
hub / github.com/wavetermdev/waveterm / convertWSCommand

Function convertWSCommand

pkg/service/service.go:102–111  ·  view source on GitHub ↗
(argType reflect.Type, jsonArg any)

Source from the content-addressed store, hash-verified

100}
101
102func 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
113func convertSpecial(argType reflect.Type, jsonArg any) (any, error) {
114 jsonType := reflect.TypeOf(jsonArg)

Callers 1

convertSpecialFunction · 0.85

Calls 1

ParseWSCommandMapFunction · 0.92

Tested by

no test coverage detected