Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions wsjson/wsjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import (

// Read reads a JSON message from c into v.
// It will reuse buffers in between calls to avoid allocations.
//
// If the message cannot be unmarshalled into v, Read closes the connection
// with websocket.StatusInvalidFramePayloadData and returns an error wrapping
// the unmarshal error. To keep the connection open on bad JSON, read the
// message with c.Read and call json.Unmarshal yourself.
func Read(ctx context.Context, c *websocket.Conn, v any) error {
return read(ctx, c, v)
}
Expand Down
Loading