- Notifications
You must be signed in to change notification settings - Fork 336
Closed
Description
funcread(ctx context.Context, c*websocket.Conn) ([]byte, error){ctx, cancel:=context.WithTimeout(ctx, time.Minute*30) defercancel() _, r, err:=c.Reader(ctx) iferr!=nil{returnnil, err } // One minute max to read the received message.time.AfterFunc(time.Minute, cancel) returnioutil.ReadAll(r) }That code should be good in an example under Reader.
Related #86