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
CL 59310 added the ability to set the central directory comment in zip.Writer. By analogy with Reader, it added a new Comment string field to writer that callers who care must set before calling Close. It doesn't seem right to me that this is the very first exported field in the Writer struct, and it doesn't seem to match the rest of the operation-based writing API. For example we do not write files by setting an exported Files []struct{FileInfo; io.Reader} in the Writer and then calling Close. I think it would be more in keeping with the rest of Writer's API to instead make setting the comment an explicit method SetComment(string) and leave Writer with no unexported fields.
CL 59310 added the ability to set the central directory comment in zip.Writer. By analogy with Reader, it added a new
Comment string
field to writer that callers who care must set before calling Close. It doesn't seem right to me that this is the very first exported field in the Writer struct, and it doesn't seem to match the rest of the operation-based writing API. For example we do not write files by setting an exportedFiles []struct{FileInfo; io.Reader}
in the Writer and then calling Close. I think it would be more in keeping with the rest of Writer's API to instead make setting the comment an explicit methodSetComment(string)
and leave Writer with no unexported fields./cc @dsnet
The text was updated successfully, but these errors were encountered: