1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

Add mvc.Application.EnableStructDependents() and app.ConfigureContainer().EnableStructDependents()

relative to: #2158
This commit is contained in:
Gerasimos (Makis) Maropoulos
2023-07-17 18:30:45 +03:00
parent 6add1ba49b
commit d254d48f34
11 changed files with 85 additions and 34 deletions

View File

@@ -524,7 +524,7 @@ func TestBindingsForStruct(t *testing.T) {
}
for i, tt := range tests {
bindings := getBindingsForStruct(reflect.ValueOf(tt.Value), tt.Registered, false, false, DefaultDependencyMatcher, 0, nil)
bindings := getBindingsForStruct(reflect.ValueOf(tt.Value), tt.Registered, false, false, false, DefaultDependencyMatcher, 0, nil)
if expected, got := len(tt.Expected), len(bindings); expected != got {
t.Logf("[%d] expected bindings length to be: %d but got: %d:\n", i, expected, got)
@@ -565,5 +565,5 @@ func TestBindingsForStructMarkExportedFieldsAsRequred(t *testing.T) {
}
// should panic if fail.
_ = getBindingsForStruct(reflect.ValueOf(new(controller)), dependencies, true, true, DefaultDependencyMatcher, 0, nil)
_ = getBindingsForStruct(reflect.ValueOf(new(controller)), dependencies, true, true, false, DefaultDependencyMatcher, 0, nil)
}