(ctxErr error, closeErr <-chan error)
| 122 | } |
| 123 | |
| 124 | func decodeContextError(ctxErr error, closeErr <-chan error) error { |
| 125 | select { |
| 126 | case err, ok := <-closeErr: |
| 127 | if ok && err != nil && !errors.Is(err, io.ErrClosedPipe) { |
| 128 | return errors.Join(ctxErr, fmt.Errorf("sse: close body after context cancellation: %w", err)) |
| 129 | } |
| 130 | default: |
| 131 | } |
| 132 | return ctxErr |
| 133 | } |
| 134 | |
| 135 | func decodeLine(line string, event *Event, dataBuffer *[]byte) (bool, error) { |
| 136 | if line == "" { |