-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
This is really a superset of #4.
Currently,
Lines 93 to 96 in 809d437
| if len(b)%2 == 1 { // data size must be aligned to an even byte | |
| n2, _ := aw.w.Write([]byte{'\n'}) | |
| return n+n2, err | |
| } |
essentially closes the file after each call to
Write, which means you can't use the API to write a file one piece at a time (e.g. with io.Copy, or dumping out from a stream),
It should only write that footer when aw.nb == 0.
In my opinion, the best way to handle this would be to follow the example of archive/tar and don't write the file footer until either the next call to WriteHeader() or Close(). Of course that would require introduction of a Close method, which would be a breaking API change.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels