You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: improve error handling, encapsulate logic, and streamline flow in rescaffold command
- Improved error handling by wrapping errors with `fmt.Errorf` and propagating them instead of using `log.Fatalf`. This ensures better debugging and more graceful error recovery.
- Encapsulated repeated logic such as directory changes, config loading, and path handling into dedicated helper functions, reducing redundancy and improving code readability.
- Ensured consistent logging: logging is reserved for informative messages like plugin migration steps, while error handling uses `fmt.Errorf` for consistency.
- Simplified control flow by removing redundant error checks and unnecessary logic, making the code easier to follow without altering functionality.
- Renamed methods to improve clarity and follow established naming conventions.
- Avoided unnecessary exports by keeping methods private where applicable.
- Ensured the refactored code is properly encapsulated under the command structure (`rescaffold`) as part of the appropriate command directory structure.
0 commit comments