How dependency injection works with Wire in Nunu
mainNunu uses the Wire framework to manage dependency injection, ensuring modularity and decoupling.
Instead of manually wiring dependencies, you define them in a wire.go file specific to a subcommand. Wire then precompiles these definitions to generate a wire_gen.go file.
Key Files:
cmd/[subcommand]/wire.go: The configuration file where you define dependencies for that specific subcommand (e.g.,serverormigration).cmd/[subcommand]/wire/wire_gen.go: The automatically generated file containing the injection logic. Do not modify this file manually.
For more details, refer to the official Wire documentation.