This commit adds comprehensive docstrings to all Go files in the root of the repository, achieving 100% documentation coverage. Examples have been included where appropriate to improve clarity.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Previously, the `NewWithFactories` function in `runtime_pkg.go` iterated over an empty slice, which prevented any services from being created from the provided factories. This commit fixes the loop to correctly iterate over the keys of the `factories` map, ensuring that services are properly instantiated and registered.
feat(testing): Add Good, Bad, and Ugly tests for NewWithFactories
To improve test quality and ensure the reliability of the `NewWithFactories` function, this commit replaces the existing basic test with a comprehensive test suite following the Good, Bad, Ugly methodology:
- `TestNewWithFactories_Good`: Verifies the happy path, ensuring a service is created and registered successfully.
- `TestNewWithFactories_Bad`: Checks that the function correctly returns an error when a service factory fails.
- `TestNewWithFactories_Ugly`: Confirms that the function panics when a `nil` factory is provided, as this represents an unrecoverable programmer error.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Move Go files from core, e, and runtime directories to the project root.
- Unify package declarations to a single 'core' package.
- Update go.work to exclude the cmd directory from the main build.
- Resolve naming conflicts and update import paths.
- Fix tests to work with the new structure.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>