Dan just pointed out that the Close() method for the gzip reader actually
does other things. If you are ok with not detecting a possible error with
deferred reporting through the Close() method then, yes, you are ok. I see
no good reason why you would though.


On Mon, Jun 21, 2021 at 3:30 PM Steven Penny <srp...@gmail.com> wrote:

> > Not to mention this all is an implementation detail and even if it did
> > nothing today, relying on this behavior would be a recipe so see cobe
> > breaking in the future. In this sense, the advice "if there is a Close()
> > method, call it when you are done with it" is a very good one.
>
> No other compress reader even has a Close method, so I think Im fine:
>
> - https://golang.org/pkg/compress/bzip2
> - https://golang.org/pkg/compress/flate
> - https://golang.org/pkg/compress/lzw
> - https://golang.org/pkg/compress/zlib
>

-- 
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/CAEd86Ty1wFfrwHY%2BfjJ4-4_EHNbxh-wAb%2BWCEePQP%2BqCVC7oxg%40mail.gmail.com.

Reply via email to