Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/DoNewsCode/core
/ ExampleC_AddModule_simple
Function
ExampleC_AddModule_simple
example_test.go:34–41 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
32
}
33
34
func
ExampleC_AddModule_simple() {
35
type
Foo
struct
{}
36
c := core.New()
37
c.AddModule(Foo{})
38
fmt.Printf(
"%T\n"
, c.Modules()...)
39
// Output:
40
// core_test.Foo
41
}
42
43
func
ExampleC_AddModule_inject() {
44
type
Foo
struct
{
Callers
nothing calls this directly
Calls
4
New
Function · 0.92
Modules
Method · 0.65
AddModule
Method · 0.45
Printf
Method · 0.45
Tested by
no test coverage detected