Draft
Conversation
1464f39 to
c380ddb
Compare
93340bd to
916803d
Compare
916803d to
06c97b7
Compare
EtienneM
commented
Mar 6, 2026
| Render(ctx context.Context, apps []*scalingo.App) error | ||
| } | ||
|
|
||
| func List(ctx context.Context, renderer ListRenderer, projectSlug string) error { |
Member
Author
There was a problem hiding this comment.
What I like with this pattern is that the List command does not know anything about the format. It just need to calls Render.
| ) | ||
|
|
||
| func List(ctx context.Context, projectSlug string) error { | ||
| type ListRenderer interface { |
Member
Author
There was a problem hiding this comment.
What I don't like is that it would require an interface per command. I don't really like that. I would love to have a single interface whatever the command. And the command only calls Render(ctx). Then we would need a way to inject the data (list of apps or anything else depending on the command) in the renderer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For now I just want to introduce this pattern in a single command in order to have inputs on the code organization. The purpose would be that after this PR, it's easy to slowly update the existing commands.
Fix #512