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

Issue 6632046: code review 6632046: bytes, strings: add (*Reader).WriteTo (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by eds
Modified:
11 years, 6 months ago
Reviewers:
CC:
golang-dev, bradfitz, remyoudompheng, r, dfc
Visibility:
Public.

Description

bytes, strings: add (*Reader).WriteTo Fixes issue 4031.

Patch Set 1 #

Patch Set 2 : diff -r 3350c94fe6b7 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 3350c94fe6b7 https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 4 : diff -r 3350c94fe6b7 https://go.googlecode.com/hg/ #

Total comments: 11

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

Total comments: 2

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

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

Total comments: 3

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -4 lines) Patch
M src/pkg/bytes/buffer_test.go View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/bytes/reader.go View 1 2 3 4 5 6 7 2 chunks +20 lines, -1 line 0 comments Download
M src/pkg/bytes/reader_test.go View 1 2 3 4 5 6 1 chunk +21 lines, -0 lines 0 comments Download
M src/pkg/strings/reader.go View 1 2 3 4 5 6 7 2 chunks +20 lines, -1 line 0 comments Download
M src/pkg/strings/reader_test.go View 1 2 3 4 5 6 2 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 23
eds
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 6 months ago (2012-10-08 21:58:12 UTC) #1
bradfitz
https://codereview.appspot.com/6632046/diff/1002/src/pkg/bytes/reader.go File src/pkg/bytes/reader.go (right): https://codereview.appspot.com/6632046/diff/1002/src/pkg/bytes/reader.go#newcode131 src/pkg/bytes/reader.go:131: m, e := w.Write(b) I can see the advantage ...
11 years, 6 months ago (2012-10-09 04:46:53 UTC) #2
eds
Hello golang-dev@googlegroups.com, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 6 months ago (2012-10-09 05:58:09 UTC) #3
bradfitz
https://codereview.appspot.com/6632046/diff/7002/src/pkg/bytes/reader.go File src/pkg/bytes/reader.go (right): https://codereview.appspot.com/6632046/diff/7002/src/pkg/bytes/reader.go#newcode133 src/pkg/bytes/reader.go:133: panic("bytes.Reader.WriteTo: invalid Write count") I'm not sure this is ...
11 years, 6 months ago (2012-10-09 18:23:56 UTC) #4
eds
https://codereview.appspot.com/6632046/diff/7002/src/pkg/bytes/reader.go File src/pkg/bytes/reader.go (right): https://codereview.appspot.com/6632046/diff/7002/src/pkg/bytes/reader.go#newcode133 src/pkg/bytes/reader.go:133: panic("bytes.Reader.WriteTo: invalid Write count") On 2012/10/09 18:23:57, bradfitz wrote: ...
11 years, 6 months ago (2012-10-09 18:27:31 UTC) #5
bradfitz
On Tue, Oct 9, 2012 at 11:27 AM, <chickencha@gmail.com> wrote: > > https://codereview.appspot.**com/6632046/diff/7002/src/pkg/** > bytes/reader.go<https://codereview.appspot.com/6632046/diff/7002/src/pkg/bytes/reader.go> ...
11 years, 6 months ago (2012-10-09 18:31:34 UTC) #6
remyoudompheng
http://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go File src/pkg/strings/reader.go (right): http://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go#newcode130 src/pkg/strings/reader.go:130: m, e := io.WriteString(w, s) if the writer has ...
11 years, 6 months ago (2012-10-09 21:58:45 UTC) #7
bradfitz
https://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go File src/pkg/strings/reader.go (right): https://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go#newcode130 src/pkg/strings/reader.go:130: m, e := io.WriteString(w, s) On 2012/10/09 21:58:46, remyoudompheng ...
11 years, 6 months ago (2012-10-09 22:04:47 UTC) #8
r
http://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go File src/pkg/strings/reader.go (right): http://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go#newcode130 src/pkg/strings/reader.go:130: m, e := io.WriteString(w, s) I lean towards leaving ...
11 years, 6 months ago (2012-10-10 02:39:21 UTC) #9
r
I guess that wasn't very helpful. Apologies for that. -rob
11 years, 6 months ago (2012-10-10 02:40:07 UTC) #10
bradfitz
I think WriteString is fine. Safer, less surprising default. And not changing behavior. Thoughts though ...
11 years, 6 months ago (2012-10-10 02:58:28 UTC) #11
eds
http://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go File src/pkg/strings/reader.go (right): http://codereview.appspot.com/6632046/diff/7002/src/pkg/strings/reader.go#newcode130 src/pkg/strings/reader.go:130: m, e := io.WriteString(w, s) On 2012/10/10 02:39:21, r ...
11 years, 6 months ago (2012-10-10 03:00:18 UTC) #12
r
http://codereview.appspot.com/6632046/diff/7002/src/pkg/bytes/reader.go File src/pkg/bytes/reader.go (right): http://codereview.appspot.com/6632046/diff/7002/src/pkg/bytes/reader.go#newcode133 src/pkg/bytes/reader.go:133: panic("bytes.Reader.WriteTo: invalid Write count") it's the caller's error not ...
11 years, 6 months ago (2012-10-10 03:16:22 UTC) #13
eds
Hello golang-dev@googlegroups.com, bradfitz@golang.org, remyoudompheng@gmail.com, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 6 months ago (2012-10-10 22:42:55 UTC) #14
bradfitz
LGTM after nits Will give Rob a day or so for final comments before submitting ...
11 years, 6 months ago (2012-10-10 22:48:28 UTC) #15
eds
Hello golang-dev@googlegroups.com, bradfitz@golang.org, remyoudompheng@gmail.com, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 6 months ago (2012-10-10 22:50:44 UTC) #16
dfc
LGTM with some minor grumbling about unnecessary named return values. https://codereview.appspot.com/6632046/diff/9007/src/pkg/bytes/reader.go File src/pkg/bytes/reader.go (right): https://codereview.appspot.com/6632046/diff/9007/src/pkg/bytes/reader.go#newcode125 ...
11 years, 6 months ago (2012-10-10 23:51:52 UTC) #17
bradfitz
https://codereview.appspot.com/6632046/diff/9007/src/pkg/bytes/reader.go File src/pkg/bytes/reader.go (right): https://codereview.appspot.com/6632046/diff/9007/src/pkg/bytes/reader.go#newcode125 src/pkg/bytes/reader.go:125: func (r *Reader) WriteTo(w io.Writer) (n int64, err error) ...
11 years, 6 months ago (2012-10-11 00:06:29 UTC) #18
dfc
Fair enough. Please ignore my comments. On 11 Oct 2012 11:06, <bradfitz@golang.org> wrote: > > ...
11 years, 6 months ago (2012-10-11 00:14:09 UTC) #19
r
This CL breaks net/http. --- FAIL: TestHeadResponses (0.00 seconds) serve_test.go:548: on Copy, expected ErrBodyNotAllowed, got ...
11 years, 6 months ago (2012-10-12 01:36:38 UTC) #20
eds
Hello golang-dev@googlegroups.com, bradfitz@golang.org, remyoudompheng@gmail.com, r@golang.org, dave@cheney.net (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 6 months ago (2012-10-12 01:45:13 UTC) #21
r
LGTM will submit
11 years, 6 months ago (2012-10-12 03:40:55 UTC) #22
r
11 years, 6 months ago (2012-10-12 03:43:57 UTC) #23
*** Submitted as http://code.google.com/p/go/source/detail?r=67edfdb4413a ***

bytes, strings: add (*Reader).WriteTo

Fixes issue 4031.

R=golang-dev, bradfitz, remyoudompheng, r, dave
CC=golang-dev
http://codereview.appspot.com/6632046

Committer: Rob Pike <r@golang.org>
Sign in to reply to this message.

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