Write implements net.Conn by appending to the buffered output.
(b []byte)
| 857 | |
| 858 | // Write implements net.Conn by appending to the buffered output. |
| 859 | func (c *testConn) Write(b []byte) (int, error) { |
| 860 | c.Lock() |
| 861 | defer c.Unlock() |
| 862 | |
| 863 | if c.isClosed { |
| 864 | return 0, errTestConnClosed |
| 865 | } |
| 866 | return c.w.Write(b) //nolint:wrapcheck // This must not be wrapped |
| 867 | } |
| 868 | |
| 869 | // Close marks the connection as closed and prevents further writes. |
| 870 | func (c *testConn) Close() error { |