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

Don't store data field - POC #2165

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joejstuart
Copy link
Member

@joejstuart joejstuart commented Nov 15, 2024

POC of writing results to a file then streaming them to stdout. This only writes the data field from the results struct.

@joejstuart joejstuart marked this pull request as draft November 15, 2024 13:41
@joejstuart joejstuart changed the title Tempfiles data Don't store data - POC Nov 15, 2024

encoder := gob.NewEncoder(tempFile)
if err := encoder.Encode(manyData); err != nil {
fmt.Printf("failed to encode batch: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fmt.Errorf if you're doing error wrapping.

Write data to files, then stream to stdout.
@joejstuart joejstuart changed the title Don't store data - POC Don't store data field - POC Nov 15, 2024
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.

2 participants