]> Cypherpunks repositories - gostls13.git/commitdiff
compress/zlib: mention that NewReaderDict can return ErrDictionary
authorRuss Cox <rsc@golang.org>
Tue, 30 Sep 2014 16:30:31 +0000 (12:30 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 30 Sep 2014 16:30:31 +0000 (12:30 -0400)
Fixes #7935.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, ruiu
https://golang.org/cl/147390043

src/compress/zlib/reader.go

index 9e1aafda9b61e4a9a7a6a4a1d458fc3871275937..e1191816d6a87af5ce992d615c9e2f613769b639 100644 (file)
@@ -61,6 +61,7 @@ func NewReader(r io.Reader) (io.ReadCloser, error) {
 
 // NewReaderDict is like NewReader but uses a preset dictionary.
 // NewReaderDict ignores the dictionary if the compressed data does not refer to it.
+// If the compressed data refers to a different dictionary, NewReaderDict returns ErrDictionary.
 func NewReaderDict(r io.Reader, dict []byte) (io.ReadCloser, error) {
        z := new(reader)
        if fr, ok := r.(flate.Reader); ok {