What version of Go are you using (go version)?
https://pkg.go.dev/archive/zip@go1.20rc3
Does this issue reproduce with the latest release?
Yes
What did you do?
(https://go.dev/play/p/NFjouX0xrQk?v=gotip)
- Create a
zip archive containing a directory entry.
- Open a
zip.Reader for that archive.
- Open the
zip.File for the directory entry using (*zip.Reader).Open and Read it.
- Open the
zip.File for the directory by calling (*zip.File).Open and Read it.
What did you expect to see?
The same contents (and same error code) regardless of how the directory entry was opened.
What did you see instead?
The reader opened via (*zip.Reader).Open returns a non-nil error like read dir: is a directory.
The reader opened via (*zip.File).Open returns 0, io.EOF.
(attn @dsnet @bradfitz; CC @neild)
What version of Go are you using (
go version)?https://pkg.go.dev/archive/zip@go1.20rc3
Does this issue reproduce with the latest release?
Yes
What did you do?
(https://go.dev/play/p/NFjouX0xrQk?v=gotip)
ziparchive containing a directory entry.zip.Readerfor that archive.zip.Filefor the directory entry using(*zip.Reader).OpenandReadit.zip.Filefor the directory by calling(*zip.File).OpenandReadit.What did you expect to see?
The same contents (and same error code) regardless of how the directory entry was opened.
What did you see instead?
The reader opened via
(*zip.Reader).Openreturns a non-nil error likeread dir: is a directory.The reader opened via
(*zip.File).Openreturns0, io.EOF.(attn @dsnet @bradfitz; CC @neild)