mirror of
https://github.com/kataras/iris.git
synced 2025-02-09 02:34:55 +01:00
fix check for singleton on fillStruct - no problem let's set all the static values on the first value although it may never be needed if request-scoped/stateless (No Singleton di.State)
Former-commit-id: a72bcd720d900fdc009cabb1e4a0b455026710fd
This commit is contained in:
parent
6285622cfa
commit
fd0f3ed6cb
|
@ -143,7 +143,7 @@ func (s *StructInjector) fillStruct() {
|
||||||
// if field is Static then set it to the value that passed by the caller,
|
// if field is Static then set it to the value that passed by the caller,
|
||||||
// so will have the static bindings already and we can just use that value instead
|
// so will have the static bindings already and we can just use that value instead
|
||||||
// of creating new instance.
|
// of creating new instance.
|
||||||
if s.State == Singleton && f.Object.BindType == Static {
|
if f.Object.BindType == Static {
|
||||||
destElem.FieldByIndex(f.FieldIndex).Set(f.Object.Value)
|
destElem.FieldByIndex(f.FieldIndex).Set(f.Object.Value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user