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

Closed
rsc opened this issue Nov 15, 2017 · 1 comment
Closed

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

rsc opened this issue Nov 15, 2017 · 1 comment

Comments

@rsc
Copy link
Contributor

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
@gopherbot
Copy link

Change https://golang.org/cl/79415 mentions this issue: archive/zip: replace Writer.Comment field with SetComment method

@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.
Projects
None yet
Development

No branches or pull requests

2 participants