Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive/zip: change Writer.Comment field to SetComment method #22737

rsc opened this issue Nov 15, 2017 · 1 comment

archive/zip: change Writer.Comment field to SetComment method #22737

rsc opened this issue Nov 15, 2017 · 1 comment


Copy link

@rsc rsc commented Nov 15, 2017

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.

/cc @dsnet

@rsc rsc added this to the Go1.10 milestone Nov 15, 2017
@rsc rsc added the release-blocker label Nov 15, 2017
Copy link

@gopherbot gopherbot commented Nov 22, 2017

Change mentions this issue: archive/zip: replace Writer.Comment field with SetComment method

@gopherbot gopherbot closed this in be67e26 Nov 29, 2017
@golang golang locked and limited conversation to collaborators Nov 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.