From 34f6f85483b5030879a6eb2beb1a11ece1da3a23 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Thu, 15 Jul 2021 22:19:06 +0800 Subject: [PATCH] fix stat marshalJSON. --- client/statistics.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/statistics.go b/client/statistics.go index 65bde7f3..178603da 100644 --- a/client/statistics.go +++ b/client/statistics.go @@ -20,6 +20,7 @@ type Statistics struct { func (s *Statistics) MarshalJSON() ([]byte, error) { var w bytes.Buffer w.Grow(256) + w.WriteString(`{"packet_received":`) w.WriteString(strconv.FormatUint(atomic.LoadUint64(&s.PacketReceived), 10)) w.WriteString(`,"packet_sent":`) w.WriteString(strconv.FormatUint(atomic.LoadUint64(&s.PacketSent), 10))