Read reads a JSON message from c into v. It will reuse buffers in between calls to avoid allocations.
(ctx context.Context, c *websocket.Conn, v any)
| 15 | // Read reads a JSON message from c into v. |
| 16 | // It will reuse buffers in between calls to avoid allocations. |
| 17 | func Read(ctx context.Context, c *websocket.Conn, v any) error { |
| 18 | return read(ctx, c, v) |
| 19 | } |
| 20 | |
| 21 | func read(ctx context.Context, c *websocket.Conn, v any) (err error) { |
| 22 | defer errd.Wrap(&err, "failed to read JSON message") |
searching dependent graphs…