(ctx context.Context, r io.Reader)
| 1188 | } |
| 1189 | |
| 1190 | func newContextReader(ctx context.Context, r io.Reader) io.Reader { |
| 1191 | if ctx == nil { |
| 1192 | return r |
| 1193 | } |
| 1194 | return &contextReader{ctx: ctx, r: r} |
| 1195 | } |
| 1196 | |
| 1197 | func (r *contextReader) Read(p []byte) (int, error) { |
| 1198 | select { |