-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance Rendering Functions by Adopting io.Reader and io.Writer for Rendering Functions Across cocli #21
Comments
@deeglaze as pr your suggestions i have updated reading from an io.Reader and writing to an io.Writer..... |
While this is certainly true, it is unclear to me where we expect these to be reused outside the narrow context of the CLI. |
I find myself calling the Golang libraries from Go rather than using subprocess with dup2 etc etc for using "cli" tools. Specifically having a corim pretty printer only through cocli is a little unfortunate. |
@thomas-fossati, I understand your concern regarding the narrow use within the CLI. The shift to io.Reader and io.Writer was aimed at improving flexibility and reusability, especially for scenarios like testing, web integrations, or tools where direct data handling is beneficial without relying on subprocess calls |
@deeglaze, I agree that using Go libraries directly can simplify usage compared to subprocess approaches like dup2. The current refactor aims to make the rendering functions more adaptable while keeping the core functionality intact. Let me know if there's anything specific you'd like adjusted further. |
It makes total sense, but wouldn't that be in the scope of |
All right, the "unit testing" use case looks like a compelling one. |
Current Issue: Rendering functions have rigid input and output types, limiting their flexibility and reusability.
Proposed Solution: Modify rendering functions to accept io.Reader for input and io.Writer for output. This change will allow functions to handle various data sources and destinations seamlessly.
The text was updated successfully, but these errors were encountered: