Skip to content
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

Use io.Writer in formatters #317

Merged
merged 4 commits into from
Apr 4, 2023

Conversation

dnephin
Copy link
Member

@dnephin dnephin commented Mar 31, 2023

PR #79 first introduced support for writing output directly to an io.Writer instead of creating large strings in memory. PR #313 added eventFormatterFunc so that formatters could be implemented as closures without needing a separate struct type for each.

This PR converts all the formatters to use this new type. There are still a few places where strings are constructed, but all of those strings should be small. The large strings (output from running tests) should be written directly to stdout, avoiding the need to allocate large strings that are discarded immediately after writing them.

@dnephin dnephin merged commit b356c42 into gotestyourself:main Apr 4, 2023
@dnephin dnephin deleted the improve-formatter-writes branch April 4, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant