Skip to content

Use strings.Builder to return CLI command output instead of printing #137

@digitalghost-dev

Description

@digitalghost-dev

Refactoring CLI command functions to return strings using strings.Builder() rather than printing directly with fmt.Println().

Benefits

  • Separation of concerns: Command logic is now decoupled from output/display logic.
  • Testability: Returned strings can be easily tested without capturing stdout.
  • Reusability: Output can be logged, stored, or processed further.
  • Scalability: Supports flexible output handling in future (e.g., piping, logging, GUI).

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRefactoring existing code.

    Projects

    Status

    Completed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions