MCPcopy Create free account
hub / github.com/DoNewsCode/core / Populate

Method Populate

leader/dependency_test.go:79–95  ·  view source on GitHub ↗
(target interface{})

Source from the content-addressed store, hash-verified

77}
78
79func (m mockPopulator) Populate(target interface{}) error {
80 c := dig.New()
81 c.Provide(func() contract.AppName {
82 return config.AppName("foo")
83 })
84 c.Provide(func() contract.Env {
85 return config.EnvUnknown
86 })
87 c.Provide(func() otetcd.Maker {
88 return &mockMaker{"default", m.endpoints}
89 })
90 c.Provide(func() contract.ConfigUnmarshaler {
91 return config.MapAdapter{}
92 })
93 p := di.IntoPopulator(c)
94 return p.Populate(target)
95}
96
97func TestDefaultDriver(t *testing.T) {
98 if os.Getenv("ETCD_ADDR") == "" {

Callers

nothing calls this directly

Calls 4

AppNameTypeAlias · 0.92
IntoPopulatorFunction · 0.92
ProvideMethod · 0.80
PopulateMethod · 0.65

Tested by

no test coverage detected