MCPcopy Index your code
hub / github.com/wailsapp/wails / Call

Method Call

v2/internal/binding/boundMethod.go:62–109  ·  view source on GitHub ↗

Call will attempt to call this bound method with the given args

(args []interface{})

Source from the content-addressed store, hash-verified

60
61// Call will attempt to call this bound method with the given args
62func (b *BoundMethod) Call(args []interface{}) (interface{}, error) {
63 // Check inputs
64 expectedInputLength := len(b.Inputs)
65 actualInputLength := len(args)
66 if expectedInputLength != actualInputLength {
67 return nil, fmt.Errorf("%s takes %d inputs. Received %d", b.Path.FullName(), expectedInputLength, actualInputLength)
68 }
69
70 /** Convert inputs to reflect values **/
71
72 // Create slice for the input arguments to the method call
73 callArgs := make([]reflect.Value, expectedInputLength)
74
75 // Iterate over given arguments
76 for index, arg := range args {
77 // Save the converted argument
78 callArgs[index] = reflect.ValueOf(arg)
79 }
80
81 // Do the call
82 callResults := b.Method.Call(callArgs)
83
84 //** Check results **//
85 var returnValue interface{}
86 var err error
87
88 switch b.OutputCount() {
89 case 1:
90 // Loop over results and determine if the result
91 // is an error or not
92 for _, result := range callResults {
93 interfac := result.Interface()
94 temp, ok := interfac.(error)
95 if ok {
96 err = temp
97 } else {
98 returnValue = interfac
99 }
100 }
101 case 2:
102 returnValue = callResults[0].Interface()
103 if temp, ok := callResults[1].Interface().(error); ok {
104 err = temp
105 }
106 }
107
108 return returnValue, err
109}

Callers 15

applicationInitFunction · 0.80
SaveHIconAsPNGFunction · 0.80
GetDPIForMonitorFunction · 0.80
InitCommonControlsExFunction · 0.80
ImageList_CreateFunction · 0.80
ImageList_DestroyFunction · 0.80
ImageList_GetImageCountFunction · 0.80
ImageList_SetImageCountFunction · 0.80
ImageList_AddFunction · 0.80
ImageList_ReplaceIconFunction · 0.80
ImageList_RemoveFunction · 0.80
TrackMouseEventFunction · 0.80

Calls 3

OutputCountMethod · 0.95
ErrorfMethod · 0.80
FullNameMethod · 0.80

Tested by

no test coverage detected