Created
December 25, 2018 13:53
-
-
Save paulsc/ca9e5437cd784cf81b2b18c1f0321ea7 to your computer and use it in GitHub Desktop.
This file contains 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
type FullBufferReader struct{ reader *io.Reader } | |
func (br *FullBufferReader) Read(p []byte) (int, error) { | |
n, err := io.ReadFull(*br.reader, p) | |
if err != nil { | |
if err == io.ErrUnexpectedEOF { | |
return n, io.EOF | |
} else { | |
return n, err | |
} | |
} | |
return n, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment