feat: ora funge tutto benissimo per qualche motivo
This commit is contained in:
@@ -28,6 +28,7 @@ func (s *slot) checkInitialized(l *ServiceLocator) error {
|
||||
|
||||
log.Printf(`initialized lazy value of type %T for slot of type %s`, v, s.typ)
|
||||
|
||||
s.created = true
|
||||
s.value = v
|
||||
}
|
||||
|
||||
@@ -47,7 +48,12 @@ func New() *ServiceLocator {
|
||||
func InjectValue[T any](l *ServiceLocator, slotKey SlotKey[T], value T) T {
|
||||
log.Printf(`injected value of type %T for slot of type %s`, value, getTypeName[T]())
|
||||
|
||||
l.providers[slotKey] = &slot{nil, true, value, getTypeName[T]()}
|
||||
l.providers[slotKey] = &slot{
|
||||
nil,
|
||||
true,
|
||||
value,
|
||||
getTypeName[T](),
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user