MCPcopy Create free account
hub / github.com/kataras/iris / TestBindingsForStruct

Function TestBindingsForStruct

hero/binding_test.go:311–530  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

309}
310
311func TestBindingsForStruct(t *testing.T) {
312 type (
313 controller struct {
314 Name string
315 Service service
316 }
317
318 embedded1 struct {
319 Age int
320 }
321
322 embedded2 struct {
323 Now time.Time
324 }
325
326 Embedded3 struct {
327 Age int
328 }
329
330 Embedded4 struct {
331 Now time.Time
332 }
333
334 controllerEmbeddingExported struct {
335 Embedded3
336 Embedded4
337 }
338
339 controllerEmbeddingUnexported struct {
340 embedded1
341 embedded2
342 }
343
344 controller2 struct {
345 Emb1 embedded1
346 Emb2 embedded2
347 }
348
349 controller3 struct {
350 Emb1 embedded1
351 emb2 embedded2 // unused
352 }
353 )
354
355 var deps = []*Dependency{
356 NewDependency("name"),
357 NewDependency(new(serviceImpl)),
358 }
359
360 var depsForAnonymousEmbedded = []*Dependency{
361 NewDependency(42),
362 NewDependency(time.Now()),
363 }
364
365 var depsForFieldsOfStruct = []*Dependency{
366 NewDependency(embedded1{Age: 42}),
367 NewDependency(embedded2{time.Now()}),
368 }

Callers

nothing calls this directly

Calls 8

NewDependencyFunction · 0.85
payloadBindingFunction · 0.85
getBindingsForStructFunction · 0.85
LogfMethod · 0.80
FailNowMethod · 0.80
FatalfMethod · 0.80
NowMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…