You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZIP formart has 2 types comment.
First, Central directory file header comment. This is already supported.
Second, End of central directory record comment. Read this comment is supported, but Write is not supported yet.
For symmetry with Reader, it is probably better to add a Writer.Comment field with the documentation that it must be set before Writer.Close is called.
@dsnet
Thank you for your reply.
Certainly, you're right that for symmetry.
I'll add a field with the document.
However, I think Reader.Comment should not be settable.
I wonder why Reader.Comment is a settable field.
ZIP formart has 2 types comment.
First, Central directory file header comment. This is already supported.
Second, End of central directory record comment. Read this comment is supported, but Write is not supported yet.
(more detail of zip format, see also: https://en.wikipedia.org/wiki/Zip_(file_format))
Not supported go source code is bellow.
https://github.com/golang/go/blob/master/src/archive/zip/writer.go#L185
I think following commit is mistake, because file header comment had been supported since Go1 released.
bcc349a
I propose to support "end of central directory record comment".
Proposal:
Add SetComment method to zip.Writer, such as bellow.
I will send patch if this proposal is acceptable.
The text was updated successfully, but these errors were encountered: