MCPcopy Index your code
hub / github.com/coder/websocket / Read

Function Read

wsjson/wsjson.go:17–19  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 5

TestConnFunction · 0.92
assertEchoFunction · 0.92
ExampleAcceptFunction · 0.92
TestGinFunction · 0.92
Test_echoServerFunction · 0.92

Calls 1

readFunction · 0.85

Tested by 5

TestConnFunction · 0.74
assertEchoFunction · 0.74
ExampleAcceptFunction · 0.74
TestGinFunction · 0.74
Test_echoServerFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…