Skip to content

Instantly share code, notes, and snippets.


azhuox/block9.go Secret

Created December 2, 2020 03:39
What would you like to do?
package io
// Reader is the interface that wraps the basic Read method.
type Reader interface {
Read(p []byte) (n int, err error)
type multiReader struct {
readers []Reader
func (mr *multiReader) Read(p []byte) (n int, err error) {
// Blah blah blah.
return 0, EOF
// MultiReader returns a Reader that's the logical concatenation of the provided input readers.
func MultiReader(readers ...Reader) Reader {
r := make([]Reader, len(readers))
copy(r, readers)
return &multiReader{r}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment