[internal.http.reader] auto-correcting (no error raised)

This commit is contained in:
xdrm-brackets 2018-04-25 15:55:32 +02:00
parent ca472fb80c
commit be8bfa012e
1 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,6 @@ package reader
// the golang standard library
import (
"fmt"
"io"
"bufio"
)
@ -22,14 +21,14 @@ type chunkReader struct {
// New creates a new reader
func NewReader(r io.Reader) (reader *chunkReader, err error) {
func NewReader(r io.Reader) (reader *chunkReader) {
br, ok := r.(*bufio.Reader)
if !ok {
return nil, fmt.Errorf("Invalid reader (must implement bufio.Reader")
br = bufio.NewReader(r)
}
return &chunkReader{reader: br}, nil
return &chunkReader{reader: br}
}