diff --git a/websocket_transport.go b/websocket_transport.go index bd8a87b..45b54a4 100644 --- a/websocket_transport.go +++ b/websocket_transport.go @@ -100,7 +100,7 @@ func (t WebsocketTransport) startReader() { if n > 0 { // We need to make a copy, otherwise we will overwrite the slice content // on the next iteration of the for loop. - tmp := make([]byte, len(buffer)) + tmp := make([]byte, n) copy(tmp, buffer) t.queue <- tmp }