goca integrate
Integrate existing features with dependency injection and routing.
Syntax
bash
goca integrate [flags]Description
Automatically detects all features in your project and integrates them by updating the dependency injection container and registering routes.
Auto-Integration
The goca feature command now includes automatic integration. Use this command when you need to repair or update integration for manually created features.
Flags
--all
Integrate all detected features.
bash
goca integrate --all--feature
Integrate a specific feature.
bash
goca integrate --feature User--dry-run
Show what would be integrated without making changes.
bash
goca integrate --all --dry-runExamples
Integrate All Features
bash
goca integrate --allOutput:
Scanning for features...
Found: User
Found: Product
Found: Order
Updating dependency injection...
Updated internal/di/container.go
Registering routes...
Updated internal/handler/http/routes.go
Integration complete! 3 features integrated.Integrate Specific Feature
bash
goca integrate --feature ProductDry Run
bash
goca integrate --all --dry-runShows what would be changed without actually modifying files.
What Gets Integrated
Dependency Injection
- Adds repositories to DI container
- Wires use cases with dependencies
- Registers handlers
HTTP Routing
- Registers all HTTP routes
- Sets up middleware
- Configures path prefixes
Database Migrations
- Creates migration files
- Registers schema changes
Use Cases
After Manual Feature Creation
If you created features manually:
bash
# You manually created files for Order feature
goca integrate --feature OrderProject Repair
If DI or routes are out of sync:
bash
goca integrate --allAfter Git Merge
After merging branches with new features:
bash
goca integrate --allSee Also
goca feature- Generate complete feature (auto-integrated)goca di- Generate DI container