From 9f6936e1ff96697dc2fac930a340c376459576c8 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 1 May 2019 12:08:24 -0600 Subject: [PATCH] small fix --- src/comm/comm.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/comm/comm.go b/src/comm/comm.go index 7ed4b3a..a19f5e6 100644 --- a/src/comm/comm.go +++ b/src/comm/comm.go @@ -69,7 +69,7 @@ func (c *Comm) Read() (buf []byte, numBytes int, bs []byte, err error) { var header []byte numBytes = 4 for { - tmp := make([]byte,numBytes-len(header)) + tmp := make([]byte, numBytes-len(header)) n, errRead := c.connection.Read(tmp) if errRead != nil { err = errRead @@ -88,6 +88,7 @@ func (c *Comm) Read() (buf []byte, numBytes int, bs []byte, err error) { fmt.Println("binary.Read failed:", err) } numBytes = int(numBytesUint32) + buf = make([]byte, 0) for { // log.Debugf("bytes: %d/%d",len(buf),numBytes) tmp := make([]byte, numBytes-len(buf))