Skip to content

Commit

Permalink
event: use bufio.NewReader
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Aug 31, 2024
1 parent ba85558 commit e2b70b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion event/event.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package event

import (
"bufio"
"fmt"
"net"
"strings"
Expand Down Expand Up @@ -39,7 +40,8 @@ func NewEventClient(socket string) (*EventClient, error) {
// alternative.
func (c *EventClient) Receive() ([]ReceivedData, error) {
buf := make([]byte, bufSize)
n, err := c.conn.Read(buf)
reader := bufio.NewReader(c.conn)
n, err := reader.Read(buf)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e2b70b5

Please sign in to comment.