mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
Document that Close must be called on the reader returned from NewStreamReader
This commit is contained in:
@@ -21,8 +21,11 @@ type StreamWriter func(w *bufio.Writer)
|
||||
//
|
||||
// The returned reader may be passed to Response.SetBodyStream.
|
||||
//
|
||||
// Close must be called on the returned reader after after all the required data
|
||||
// has been read. Otherwise goroutine leak may occur.
|
||||
//
|
||||
// See also Response.SetBodyStreamWriter.
|
||||
func NewStreamReader(sw StreamWriter) io.Reader {
|
||||
func NewStreamReader(sw StreamWriter) io.ReadCloser {
|
||||
pr, pw := io.Pipe()
|
||||
|
||||
var bw *bufio.Writer
|
||||
|
||||
Reference in New Issue
Block a user