Skip to content

Conversation

MichaelMure
Copy link
Member

No description provided.

@@ -120,3 +120,20 @@ func (ctn Writer) toWriter(header header, w io.Writer) (err error) {

return ipld.EncodeStreaming(encoder, node, cbor.Encode)
}

// ToReader convert a container Writer into a Reader.
// Most likely, you only want to use this in tests for convenience.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Most likely

Since it's not a test package, shouldn't we just return (io.Reader, error) and let the user decide?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's to a Reader, not an io.Reader.
There is really no reason to use those beside test where you do odd things. Otherwise you are only on the "writing" side or the "reading" side.

@MichaelMure MichaelMure merged commit a82bce5 into main Feb 27, 2025
6 checks passed
@MichaelMure MichaelMure deleted the cont-test branch February 27, 2025 14:00
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