From 4f05838b6c18a98f5d13e1961b81ed4199c13f44 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Mon, 28 Mar 2022 13:35:58 +0800 Subject: [PATCH] fix nil in multi reader --- client/ptt.go | 2 +- utils/sys.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ptt.go b/client/ptt.go index 6ea82280..3521b9aa 100644 --- a/client/ptt.go +++ b/client/ptt.go @@ -156,7 +156,7 @@ func (c *QQClient) UploadShortVideo(target message.Source, video, thumb io.ReadS cmd = 89 } ext, _ := proto.Marshal(c.buildPttShortVideoProto(target, videoSum, thumbSum, videoLen, thumbLen).PttShortVideoUploadReq) - combined := utils.MultiReadSeeker(thumb, video) + combined := io.MultiReader(thumb, video) input := highway.Transaction{ CommandID: cmd, Body: combined, diff --git a/utils/sys.go b/utils/sys.go index cdd8b69b..b3b11654 100644 --- a/utils/sys.go +++ b/utils/sys.go @@ -23,7 +23,7 @@ func (r *multiReadSeeker) Read(p []byte) (int, error) { readers := make([]io.Reader, len(r.readers)) for i := range r.readers { _, _ = r.readers[i].Seek(0, io.SeekStart) - readers = append(readers, r.readers[i]) + readers[i] = r.readers[i] } r.multiReader = io.MultiReader(readers...) }