On Thu, 2022-09-22 at 00:58 +0100, Rory Campbell-Lange wrote:
> interface conversion: *zip.checksumReader is not io.ReadSeeker:
> missing method Seek
>
> Advice on how to rectify this would be gratefully received.

Would it be acceptable to conditionally copy the reader's contents into
a buffer that implements io.ReadSeeker?

if rs, ok := r.(io.ReadSeeker); ok {
        useReadSeeker(rs)
} else {
        b, err := io.ReadAll(r)
        // handle err
        useReadSeeker(bytes.NewReader(b))
}


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/691c030d0e345f34ba45b0676223dbd6fdc8d055.camel%40kortschak.io.

Reply via email to