Dependency injection container in go (golang)
Also use %+v to print errors in when panic are recovered.
Use %+v
to print errors (instead of %s
) to include things like stack traces if the type of the error supports it.
Add unshared objects.
It is now possible to override a service in the Builder.
This release fixes two bugs :
Two requests could build the same object in the app scope. The first one was used by the first request, while the second one was used by all the other requests. The first one was forgotten and never closed. It could happen if the first two Get calls were done at the same time or/and if the Build function took some time to be executed.
This new version improves error handling. It should also be faster. Migrating to v2 is highly recommended and should not be too difficult. There should not be any more changes in the API for a long time.
See the README file for the migration instructions: https://github.com/sarulabs/di#migration-from-v1
The Context is still available as an alias. It will be removed in a possible v2.