MCPcopy Index your code
hub / github.com/DoNewsCode/core / Invoke

Method Invoke

c.go:442–447  ·  view source on GitHub ↗

Invoke runs the given function after instantiating its dependencies. Any arguments that the function has are treated as its dependencies. The dependencies are instantiated in an unspecified order along with any dependencies that they might have. The function may return an error to indicate failure.

(function interface{})

Source from the content-addressed store, hash-verified

440// It internally calls uber's dig library. Consult dig's documentation for
441// details. (https://pkg.go.dev/go.uber.org/dig)
442func (c *C) Invoke(function interface{}) {
443 err := c.di.Invoke(function)
444 if err != nil {
445 panic(err)
446 }
447}
448
449func isCleanup(v reflect.Type) bool {
450 if v.Kind() == reflect.Func && v.NumIn() == 0 && v.NumOut() == 0 {

Callers 15

ServeMethod · 0.80
AddModuleFuncMethod · 0.80
ExampleC_ProvideFunction · 0.80
TestC_ServeFunction · 0.80
TestC_ServeDisableFunction · 0.80
TestC_ProvideFunction · 0.80
TestC_cleanupFunction · 0.80
TestHookFunction · 0.80
ExampleFunction · 0.80
TestIntegrationFunction · 0.80
PopulateMethod · 0.80

Calls

no outgoing calls

Tested by 15

ExampleC_ProvideFunction · 0.64
TestC_ServeFunction · 0.64
TestC_ServeDisableFunction · 0.64
TestC_ProvideFunction · 0.64
TestC_cleanupFunction · 0.64
TestHookFunction · 0.64
ExampleFunction · 0.64
TestIntegrationFunction · 0.64
TestBindFunction · 0.64
TestNameFunction · 0.64
TestAsFunction · 0.64