goca integrate
Integrate existing features with dependency injection and routing.
Syntax
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.
goca integrate --all--features
Integrate a specific feature.
goca integrate --features User--dry-run
Show what would be integrated without making changes.
goca integrate --all --dry-run--force
Overwrite existing files.
goca integrate EntityName --force--backup
Back up existing files before overwriting.
goca integrate EntityName --backupExamples
Integrate All Features
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
goca integrate --features ProductDry Run
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:
# You manually created files for Order feature
goca integrate --features OrderProject Repair
If DI or routes are out of sync:
goca integrate --allAfter Git Merge
After merging branches with new features:
goca integrate --allSee Also
goca feature- Generate complete feature (auto-integrated)goca di- Generate DI container