Something like this approach (caution: untested code):
type reader struct{
*bufio.Reader
}
func newReader(rd io.Reader) reader {
return reader{bufio.NewReader(rd)}
}
func (r reader) ReadBytes(delim byte) (line []byte, err error) {
}
func (r reader) ReadBytesEx(delims []byte) (line []byte, err error) {
}
EDIT: I should have noticed that this does not help to access the source inner packages (not exported objects). Thank you Abhai for pointing this out in your comment.
source
share