Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4817)

Issue 5639057: code review 5639057: compress/gzip: NewWriter no longer returns an error. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by nigeltao
Modified:
12 years, 2 months ago
Reviewers:
r, r2
CC:
rsc, rsc1, bradfitz, golang-dev
Visibility:
Public.

Description

compress: make flate, gzip and zlib's NewWriterXxx functions all return (*Writer, error) if they take a compression level, and *Writer otherwise. Rename gzip's Compressor and Decompressor to Writer and Reader, similar to flate and zlib. Clarify commentary when writing gzip metadata that is not representable as Latin-1, and fix io.EOF comment bug. Also refactor gzip_test to be more straightforward. Fixes issue 2839.

Patch Set 1 #

Patch Set 2 : diff -r 37a5f3ad9990 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 37a5f3ad9990 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 37a5f3ad9990 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 5 : diff -r b9ae3df7a5e7 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r b9ae3df7a5e7 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r b9ae3df7a5e7 https://go.googlecode.com/hg/ #

Total comments: 15

Patch Set 8 : diff -r f63df7de30ab https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r 838fa1514da3 https://go.googlecode.com/hg/ #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -213 lines) Patch
M doc/go1.html View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
M doc/go1.tmpl View 1 2 3 4 5 1 chunk +14 lines, -0 lines 2 comments Download
M src/pkg/archive/zip/writer.go View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M src/pkg/compress/flate/deflate.go View 1 2 3 4 5 6 7 8 2 chunks +20 lines, -12 lines 0 comments Download
M src/pkg/compress/flate/deflate_test.go View 1 2 3 4 5 6 7 8 9 chunks +34 lines, -21 lines 0 comments Download
M src/pkg/compress/gzip/gunzip.go View 1 2 3 4 5 6 7 8 9 chunks +18 lines, -21 lines 0 comments Download
M src/pkg/compress/gzip/gzip.go View 1 2 3 4 5 6 7 8 8 chunks +44 lines, -28 lines 0 comments Download
M src/pkg/compress/gzip/gzip_test.go View 1 2 3 4 5 1 chunk +123 lines, -78 lines 0 comments Download
M src/pkg/compress/zlib/writer.go View 1 2 3 4 5 6 7 8 6 chunks +66 lines, -32 lines 0 comments Download
M src/pkg/compress/zlib/writer_test.go View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M src/pkg/crypto/rand/rand_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/image/png/writer.go View 1 2 3 4 5 2 chunks +2 lines, -6 lines 0 comments Download
M src/pkg/net/http/response_test.go View 1 2 3 4 5 2 chunks +2 lines, -4 lines 0 comments Download
M src/pkg/net/http/transport_test.go View 1 5 2 chunks +2 lines, -6 lines 0 comments Download

Messages

Total messages: 22
nigeltao
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 2 months ago (2012-02-08 05:18:18 UTC) #1
r
missing go1 release note
12 years, 2 months ago (2012-02-08 05:20:00 UTC) #2
nigeltao
On 8 February 2012 16:20, <r@golang.org> wrote: > missing go1 release note Done.
12 years, 2 months ago (2012-02-08 05:48:08 UTC) #3
rsc1
http://codereview.appspot.com/5639057/diff/1002/src/pkg/compress/gzip/gzip.go File src/pkg/compress/gzip/gzip.go (right): http://codereview.appspot.com/5639057/diff/1002/src/pkg/compress/gzip/gzip.go#newcode54 src/pkg/compress/gzip/gzip.go:54: // level is the compression level, which can be ...
12 years, 2 months ago (2012-02-08 05:51:20 UTC) #4
nigeltao
On 8 February 2012 16:51, <rsc@google.com> wrote: > // The compression level can be ...
12 years, 2 months ago (2012-02-08 06:12:04 UTC) #5
rsc1
I'd rather not force Dict just to use Level. Level is common; Dict is rare.
12 years, 2 months ago (2012-02-08 06:21:50 UTC) #6
nigeltao
On 8 February 2012 17:21, Russ Cox <rsc@google.com> wrote: > I'd rather not force Dict ...
12 years, 2 months ago (2012-02-08 21:40:22 UTC) #7
rsc1
On Wed, Feb 8, 2012 at 16:40, Nigel Tao <nigeltao@golang.org> wrote: > OK, how about ...
12 years, 2 months ago (2012-02-08 21:45:04 UTC) #8
nigeltao
On 9 February 2012 08:45, Russ Cox <rsc@google.com> wrote: > // document that if level ...
12 years, 2 months ago (2012-02-08 22:36:23 UTC) #9
rsc1
lgtm
12 years, 2 months ago (2012-02-08 22:36:46 UTC) #10
nigeltao
On 9 February 2012 08:45, Russ Cox <rsc@google.com> wrote: > flate.NewWriter(w io.Writer, level int, dict ...
12 years, 2 months ago (2012-02-09 02:48:52 UTC) #11
bradfitz
zlib.NewWriter could write its header on first Write or Close? On Wed, Feb 8, 2012 ...
12 years, 2 months ago (2012-02-09 02:57:15 UTC) #12
rsc1
On Wed, Feb 8, 2012 at 21:48, Nigel Tao <nigeltao@golang.org> wrote: > It turns out ...
12 years, 2 months ago (2012-02-09 03:27:33 UTC) #13
nigeltao
On 9 February 2012 14:27, Russ Cox <rsc@google.com> wrote: > Please change it back, and ...
12 years, 2 months ago (2012-02-09 03:36:35 UTC) #14
rsc
LGTM modulo comments. Maybe someone in Sydney can reread the comments before you submit. Please ...
12 years, 2 months ago (2012-02-10 00:33:48 UTC) #15
r
LGTM after fixing .html http://codereview.appspot.com/5639057/diff/3011/doc/go1.tmpl File doc/go1.tmpl (right): http://codereview.appspot.com/5639057/diff/3011/doc/go1.tmpl#newcode795 doc/go1.tmpl:795: <em>Updating</em>: .html and .tmpl differ ...
12 years, 2 months ago (2012-02-10 01:53:57 UTC) #16
nigeltao
Submitting... http://codereview.appspot.com/5639057/diff/3011/src/pkg/compress/flate/deflate_test.go File src/pkg/compress/flate/deflate_test.go (right): http://codereview.appspot.com/5639057/diff/3011/src/pkg/compress/flate/deflate_test.go#newcode84 src/pkg/compress/flate/deflate_test.go:84: w, _ := NewWriter(&buf, h.level) On 2012/02/10 00:33:48, ...
12 years, 2 months ago (2012-02-10 07:33:22 UTC) #17
nigeltao
*** Submitted as http://code.google.com/p/go/source/detail?r=caf7dca9d711 *** compress: make flate, gzip and zlib's NewWriterXxx functions all return ...
12 years, 2 months ago (2012-02-10 07:49:29 UTC) #18
r
you didn't address my comments. -rob
12 years, 2 months ago (2012-02-10 12:05:50 UTC) #19
nigeltao
On 10 February 2012 23:05, Rob 'Commander' Pike <r@golang.org> wrote: > you didn't address my ...
12 years, 2 months ago (2012-02-10 22:23:16 UTC) #20
r2
On 11/02/2012, at 9:23 AM, Nigel Tao wrote: > On 10 February 2012 23:05, Rob ...
12 years, 2 months ago (2012-02-10 22:33:03 UTC) #21
r
12 years, 2 months ago (2012-02-10 22:33:20 UTC) #22
http://codereview.appspot.com/5639057/diff/13001/doc/go1.tmpl
File doc/go1.tmpl (right):

http://codereview.appspot.com/5639057/diff/13001/doc/go1.tmpl#newcode788
doc/go1.tmpl:788: In Go 1, the NewWriterXxx functions in compress/flate,
compress/gzip and
<code>NewWriterXxx</code>
also link the packages.

http://codereview.appspot.com/5639057/diff/13001/doc/go1.tmpl#newcode789
doc/go1.tmpl:789: compress/zlib all return (*Writer, error) if they take a
compression level,
<code> throughout here.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b