From 14ad5f7a50dc2c0bacbf492c4b9cd51594b03a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=80=9D=E6=95=8F?= Date: Tue, 30 Aug 2022 11:32:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netcard.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netcard.go b/netcard.go index 2766ad8..ffa9096 100644 --- a/netcard.go +++ b/netcard.go @@ -261,14 +261,14 @@ func (nc *NetCard) runWrite() { log.Printf("get wframes bytes len: %d", len(wframe)) var buf = bytes.NewBuffer(wframe) - zdec, err := zstd.NewReader(buf) + dec := gob.NewDecoder(buf) + var bufs [][]byte + err := dec.Decode(&bufs) if err != nil { log.Panic(err) } - dec := gob.NewDecoder(buf) - var bufs [][]byte - err = dec.Decode(&bufs) + zdec, err := zstd.NewReader(buf) if err != nil { log.Panic(err) }