MCPcopy
hub / github.com/coder/websocket / Write

Function Write

wsjson/wsjson.go:48–50  ·  view source on GitHub ↗

Write writes the JSON message v to c. 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

46// Write writes the JSON message v to c.
47// It will reuse buffers in between calls to avoid allocations.
48func Write(ctx context.Context, c *websocket.Conn, v any) error {
49 return write(ctx, c, v)
50}
51
52func write(ctx context.Context, c *websocket.Conn, v any) (err error) {
53 defer errd.Wrap(&err, "failed to write JSON message")

Callers 6

TestConnFunction · 0.92
assertEchoFunction · 0.92
ExampleDialFunction · 0.92
Example_writeOnlyFunction · 0.92
TestGinFunction · 0.92
Test_echoServerFunction · 0.92

Calls 1

writeFunction · 0.85

Tested by 6

TestConnFunction · 0.74
assertEchoFunction · 0.74
ExampleDialFunction · 0.74
Example_writeOnlyFunction · 0.74
TestGinFunction · 0.74
Test_echoServerFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…