good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 4130a309 authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Fix pooling docs in wsjson

parent e79f3501
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,7 @@ import (
)
// Read reads a json message from c into v.
// If the message is larger than 128 bytes, it will use a buffer
// from a pool instead of performing an allocation.
// It will reuse buffers to avoid allocations.
func Read(ctx context.Context, c *websocket.Conn, v interface{}) error {
err := read(ctx, c, v)
if err != nil {
......@@ -52,7 +51,7 @@ func read(ctx context.Context, c *websocket.Conn, v interface{}) error {
}
// Write writes the json message v to c.
// It uses json.Encoder which automatically reuses buffers.
// It will reuse buffers to avoid allocations.
func Write(ctx context.Context, c *websocket.Conn, v interface{}) error {
err := write(ctx, c, v)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment