Commit 0a6e2461 authored by Andrew Gerrand's avatar Andrew Gerrand

archive/zip: tweak API and docs.

Fixes #2835.

R=golang-dev, n13m3y3r, r, bradfitz
CC=golang-dev
https://golang.org/cl/5645051
parent 90d43ad7
...@@ -117,7 +117,7 @@ func (rc *ReadCloser) Close() error { ...@@ -117,7 +117,7 @@ func (rc *ReadCloser) Close() error {
} }
// Open returns a ReadCloser that provides access to the File's contents. // Open returns a ReadCloser that provides access to the File's contents.
// It is safe to Open and Read from files concurrently. // Multiple files may be read concurrently.
func (f *File) Open() (rc io.ReadCloser, err error) { func (f *File) Open() (rc io.ReadCloser, err error) {
bodyOffset, err := f.findBodyOffset() bodyOffset, err := f.findBodyOffset()
if err != nil { if err != nil {
......
...@@ -19,7 +19,7 @@ import ( ...@@ -19,7 +19,7 @@ import (
// Writer implements a zip file writer. // Writer implements a zip file writer.
type Writer struct { type Writer struct {
*countWriter countWriter
dir []*header dir []*header
last *fileWriter last *fileWriter
closed bool closed bool
...@@ -32,7 +32,7 @@ type header struct { ...@@ -32,7 +32,7 @@ type header struct {
// NewWriter returns a new Writer writing a zip file to w. // NewWriter returns a new Writer writing a zip file to w.
func NewWriter(w io.Writer) *Writer { func NewWriter(w io.Writer) *Writer {
return &Writer{countWriter: &countWriter{w: bufio.NewWriter(w)}} return &Writer{countWriter: countWriter{w: bufio.NewWriter(w)}}
} }
// Close finishes writing the zip file by writing the central directory. // Close finishes writing the zip file by writing the central directory.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment