Removed reflection options from Config: The Config struct no longer includes GenerifyInterfaces and UseReflectionType fields. These options have been completely removed from the library as part of a simplification effort.
Removed ReflectionOptions type: The ReflectionOptions type has been removed. All reflection-based functionality has been eliminated in favor of compile-time type safety.
GetWithPairs API change: GetWithPairs now uses the new BindEntry interface instead of InstancePairAny. The parameter order has also changed: keyTag is now the second parameter (before elements).
Before: GetWithPairs[T](retriever, elements []InstancePairAny, optTag ...string)
After: GetWithPairs[T](retriever, elements []BindEntry, optTag ...string)
GetWith parameter order change: The keyTag parameter is now required and comes before the binder function parameter in internal methods. The public API maintains backward compatibility with optional tags.
Removed deprecated functions: The remy_deprecated.go file and all deprecated function wrappers have been removed. If you were using deprecated functions, you must migrate to the new API.
Added
BindEntry interface: New interface for passing temporary dependencies to GetWithPairs. Provides a cleaner, type-safe API compared to the previous InstancePairAny struct.
NewBindEntry[T](value T) BindEntry: Creates a BindEntry with the given value and no tag
NewBindEntryTagged[T](value T, tag string) BindEntry: Creates a BindEntry with the given value and tag
Improved type key generation: Enhanced KeyElem with better ID generation using unsafe pointers for improved performance.
Changed / Improved
Internal method signatures: All internal injector methods now use keyTag string instead of optTag ...string for better clarity and consistency. The public API maintains backward compatibility.
Storage key validation: Storage now properly validates and checks for empty keys, preventing potential issues with uninitialized bind keys.
Performance improvements: Storage access has been optimized using unsafe pointers for better performance.
Refactor
Removed reflection dependencies: All reflection-based type key generation and type identification has been removed from the core library, improving compile-time safety and performance.
Simplified injector configuration: The Config struct is now simpler and more focused, removing complex reflection options that were rarely needed.
Updated examples: All examples have been updated to use the new BindEntry API and no longer reference reflection options.
Tests
Updated all injector tests to include keyTag in internal method calls
Added tests for the new BindEntry API
Tests adapted to work without reflection options
2025-12-10v1.10.2
Fixed
Pointer type duck typing assertion: Fixed an issue where pointer types (e.g., *GoLanguage) registered as binds
could not be correctly asserted to interfaces (e.g., Language) when using duck typing. Previously,
checkSavedAsBind was only using PointerValue(), which for pointer types like *GoLanguage would return
**GoLanguage (a double pointer) that cannot be asserted to the Language interface. The function now first checks
DefaultValue() for type assertion, and if that fails, it falls back to PointerValue() which correctly returns a
pointer that can be asserted to the interface. This ensures that pointer types can be properly retrieved via duck
typing when searching for interface implementations.
2025-12-10v1.10.1
Fixed
Sub-injector GetAll delegation: Fixed an issue where sub-injectors (created via GetWith or GetWithPairs) could
not use duck typing to find interfaces from parent injectors when the sub-injector didn’t have CacheOptReturnAll
enabled. The GetAll method now correctly ignores ErrConfigNotAllowReturnAll for sub-injectors and delegates to the
parent injector, allowing duck typing to work correctly even when the sub-injector’s storage doesn’t allow GetAll
operations.
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.
2025-11-10v1.9.0
Breaking Changes
Function Naming Convention: All retrieve functions now follow a consistent naming pattern:
Functions without prefix (Get, GetAll, GetWithPairs, GetWith) now return (T, error)
Functions with Must* prefix (MustGet, MustGetAll, MustGetWithPairs, MustGetWith) panic on error
Functions with Maybe* prefix (MaybeGet, MaybeGetAll, MaybeGetWithPairs, MaybeGetWith) return zero value
on error
Deprecated functions wrapper file (remy_deprecated.go) for backward compatibility (requires build tag
remy_keep_deprecated)
NewBindKey function: Added NewBindKey[T any]() BindKey function to create a BindKey directly for a given type.
This enables using GetWithPairs with explicit BindKey even when reflection is disabled
BindOptions exposed: BindOptions type is now exposed at the top-level remy package for use in custom injector
implementations
Contains Tag field for named bindings
Contains SoftOverride field (renamed from ExpectOverride) to allow soft overrides without errors
New error types: Refactored error handling with structured error types:
ErrConfigNotAllowReturnAll: Returned when trying to use GetAll without DuckTypeElements config enabled
ErrGetElementTypeRequiresReflectionEnabled: Returned when trying to get element type from runtime value without
reflection enabled
All errors now implement proper error wrapping and can be checked with errors.Is()
Internal Changes
Refactored cycleDetectorInjector to use unified RetrieveBind method
Simplified standard_injector implementation with consolidated retrieval logic
Improved error handling consistency across all retrieve functions
Error system refactoring: Replaced old error utilities with structured error types in internal/errors package:
Created sentinel errors for backward compatibility (ErrAlreadyBoundSentinel, ErrElementNotRegisteredSentinel,
etc.)
Implemented proper error wrapping and checking with errors.Is() and errors.As()
Added error re-exports in public remy package for backward compatibility
GetWithPairs enhancement: Now supports providing BindKey directly via InstancePair.Key field, allowing usage
without reflection when keys are explicitly provided
2024
2024-05-26v1.8.2
Update GetAll method (and also duck type get) to retrieve objects stored as Bind[T]
This update add a little more overhead to check if the bind implements the type we’re searching for
Created a new function on Binds to try to prevent stack-overflow and cycle dependency get
If everything matches, this new way of returning duck-type elements will call the Generate method on bind
It must be very careful about cycle dependencies now more than ever
Add tests to cover the new duckType mode with Bind[T]
Add new functions to register constructors with the injector.