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

Function ExampleC_AddModuleFunc

example_test.go:23–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21)
22
23func ExampleC_AddModuleFunc() {
24 type Foo struct{}
25 c := core.New()
26 c.AddModuleFunc(func() (Foo, func(), error) {
27 return Foo{}, func() {}, nil
28 })
29 fmt.Printf("%T %T\n", c.Modules()...)
30 // Output:
31 // core.cleanup core_test.Foo
32}
33
34func ExampleC_AddModule_simple() {
35 type Foo struct{}

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
AddModuleFuncMethod · 0.80
ModulesMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected