Close attempts to close the reader and write. It returns an error if both failed to Close.
()
| 200 | // Close attempts to close the reader and write. It returns an error if both |
| 201 | // failed to Close. |
| 202 | func (t *TeeReadCloser) Close() error { |
| 203 | err1 := t.c.Close() |
| 204 | err2 := t.w.Close() |
| 205 | if err1 != nil { |
| 206 | return err1 |
| 207 | } |
| 208 | return err2 |
| 209 | } |
| 210 | |
| 211 | // stoppableListener serves stoppableConn and tracks their lifetime to notify |
| 212 | // when it is safe to terminate the application. |