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

Issue 2859041: encoding/line: add (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 4 months ago by agl1
Modified:
10 years, 5 months ago
Reviewers:
r, rsc
CC:
golang-dev
Visibility:
Public.

Description

encoding/line: add I needed a way to read lines without worrying about \n and \r\n.

Patch Set 1 #

Patch Set 2 : code review 2859041: encoding/pem: split line based logic into another package. #

Total comments: 12

Patch Set 3 : code review 2859041: encoding/pem: split line based logic into another package. #

Patch Set 4 : code review 2859041: encoding/line: add #

Total comments: 4

Patch Set 5 : code review 2859041: encoding/line: add #

Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -0 lines) Patch
M src/pkg/Makefile View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A src/pkg/encoding/line/Makefile View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
A src/pkg/encoding/line/line.go View 1 2 3 4 1 chunk +95 lines, -0 lines 0 comments Download
A src/pkg/encoding/line/line_test.go View 1 2 3 4 1 chunk +89 lines, -0 lines 0 comments Download

Messages

Total messages: 8
agl1
This is a continuation of http://codereview.appspot.com/2545041, but I couldn't persuade hg to believe that.
14 years, 4 months ago (2010-11-03 15:25:58 UTC) #1
r
http://codereview.appspot.com/2859041/diff/2001/src/pkg/encoding/line/line.go File src/pkg/encoding/line/line.go (right): http://codereview.appspot.com/2859041/diff/2001/src/pkg/encoding/line/line.go#newcode5 src/pkg/encoding/line/line.go:5: // This package implements a Reader and Writer which ...
14 years, 4 months ago (2010-11-03 18:18:44 UTC) #2
agl1
http://codereview.appspot.com/2859041/diff/2001/src/pkg/encoding/line/line.go File src/pkg/encoding/line/line.go (right): http://codereview.appspot.com/2859041/diff/2001/src/pkg/encoding/line/line.go#newcode5 src/pkg/encoding/line/line.go:5: // This package implements a Reader and Writer which ...
14 years, 4 months ago (2010-11-04 14:25:51 UTC) #3
rsc1
http://codereview.appspot.com/2859041/diff/2001/src/pkg/encoding/line/line.go File src/pkg/encoding/line/line.go (right): http://codereview.appspot.com/2859041/diff/2001/src/pkg/encoding/line/line.go#newcode112 src/pkg/encoding/line/line.go:112: // ReadLine tries to return a single line, not ...
14 years, 4 months ago (2010-11-04 14:51:39 UTC) #4
rsc
Still planning to add this?
14 years, 3 months ago (2010-12-07 17:57:28 UTC) #5
agl1
PTAL. I've removed the line breaker since we decided that it was too specific for ...
14 years, 3 months ago (2010-12-21 15:00:50 UTC) #6
rsc
LGTM https://codereview.appspot.com/2859041/diff/15001/src/pkg/encoding/line/line.go File src/pkg/encoding/line/line.go (right): https://codereview.appspot.com/2859041/diff/15001/src/pkg/encoding/line/line.go#newcode41 src/pkg/encoding/line/line.go:41: l.buf = l.buf[:len(l.buf)-l.consumed] This is fine. Might be ...
14 years, 2 months ago (2011-01-04 15:16:18 UTC) #7
agl1
14 years, 2 months ago (2011-01-08 15:31:08 UTC) #8
Submitted.

https://codereview.appspot.com/2859041/diff/15001/src/pkg/encoding/line/line.go
File src/pkg/encoding/line/line.go (right):

https://codereview.appspot.com/2859041/diff/15001/src/pkg/encoding/line/line....
src/pkg/encoding/line/line.go:41: l.buf = l.buf[:len(l.buf)-l.consumed]
On 2011/01/04 15:16:18, rsc wrote:
> This is fine.  Might be clearer as
> 
> n := copy(l.buf, l.buf[l.consumed:])
> l.buf = l.buf[:n]

Done.

https://codereview.appspot.com/2859041/diff/15001/src/pkg/encoding/line/line_...
File src/pkg/encoding/line/line_test.go (right):

https://codereview.appspot.com/2859041/diff/15001/src/pkg/encoding/line/line_...
src/pkg/encoding/line/line_test.go:55: } else {
On 2011/01/04 15:16:18, rsc wrote:
> Errorf doesn't stop the test; do you really want } else { here?
> (Fatalf does)
> 
> If you do switch to Fatalf, can still drop the else.

Done.
Sign in to reply to this message.

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