Skip to main content
Remy DI - Dependency Injection for Go
GitHub Go Docs Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

v1.10.0

Added

  • Module system for composing registrations:
    • NewModule(registers ...ModuleRegister) Module
    • RegisterModule(inj Injector, modules ...Module) error
    • RegisterModuleFunc(inj Injector, fns ...func(Injector)) error
  • Module helpers (functional options) to adapt existing Register API for modules:
    • WithBind, WithInstance, WithFactory, WithSingleton, WithLazySingleton
    • WithConstructor, WithConstructor1, WithConstructor2, WithConstructor3, WithConstructor4 (error-returning only)
  • Context-aware retrieval: GetWithContext[T](inj Injector, ctx context.Context) (T, error)

Changed / Improved

  • Documentation reorganized and expanded:
    • New Modules section with usage examples
    • Retrieve Type docs expanded, including duck typing guidance and GetAll family for multiple matches

Performance

  • Avoid unnecessary duck-typing checks for non-interface requests, improving Get performance when DuckTypeElements is enabled but a concrete type is requested.
  • Minor optimizations to error creation paths.

Fixed

  • Wrap GetAll error on parent injector to provide clearer error propagation when resolving across parent/child injectors.
  • Ensure generifyInterface option only applies to interfaces.
  • Various documentation fixes and consistency updates.

Refactor

  • Moved storage implementation into a dedicated internal package for clearer boundaries.
  • Internal cleanups and lint fixes.

Tests

  • Added tests for module registration, constructor helpers within modules, recovery/partial application on module errors, and composing multiple modules.
  • Added test to ensure parallel calls for Get methods behave as expected.