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

Issue 4370048: code review 4370048: gotest: handle \r\n returned by gomake on Windows (fixe... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by brainman
Modified:
13 years, 1 month ago
Reviewers:
r
CC:
golang-dev, peterGo, rsc1, Joe Poirier
Visibility:
Public.

Description

gotest: handle \r\n returned by gomake on Windows (fixes build)

Patch Set 1 #

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

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

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

Total comments: 1

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

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M src/cmd/gotest/gotest.go View 1 2 3 1 chunk +3 lines, -0 lines 1 comment Download

Messages

Total messages: 8
brainman
Hello golang-dev@googlegroups.com (cc: Joe Poirier), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 1 month ago (2011-04-08 11:22:50 UTC) #1
brainman
Please see latest patch set. Test for empty string added. Alex
13 years, 1 month ago (2011-04-08 11:46:21 UTC) #2
peterGo
http://codereview.appspot.com/4370048/diff/5001/src/cmd/gotest/gotest.go File src/cmd/gotest/gotest.go (right): http://codereview.appspot.com/4370048/diff/5001/src/cmd/gotest/gotest.go#newcode241 src/cmd/gotest/gotest.go:241: s = s[:len(s)-1] In addition to trimming right '\n' ...
13 years, 1 month ago (2011-04-08 13:04:56 UTC) #3
rsc1
LGTM > http://codereview.appspot.com/4370048/diff/5001/src/cmd/gotest/gotest.go#newcode241 > src/cmd/gotest/gotest.go:241: s = s[:len(s)-1] > In addition to trimming right '\n' ...
13 years, 1 month ago (2011-04-08 13:14:15 UTC) #4
brainman
> src/cmd/gotest/gotest.go:241: s = s[:len(s)-1] > In addition to trimming right '\n' and '\r'+'\n', aren't ...
13 years, 1 month ago (2011-04-08 13:47:16 UTC) #5
brainman
*** Submitted as http://code.google.com/p/go/source/detail?r=8b55e8fccd53 *** gotest: handle \r\n returned by gomake on Windows (fixes build) ...
13 years, 1 month ago (2011-04-08 13:54:05 UTC) #6
rsc1
> It is by accident. I haven't used system that use \r as line delimiter ...
13 years, 1 month ago (2011-04-08 14:05:48 UTC) #7
r
13 years, 1 month ago (2011-04-08 14:36:44 UTC) #8
http://codereview.appspot.com/4370048/diff/8001/src/cmd/gotest/gotest.go
File src/cmd/gotest/gotest.go (right):

http://codereview.appspot.com/4370048/diff/8001/src/cmd/gotest/gotest.go#newc...
src/cmd/gotest/gotest.go:246: return s
this doesn't get the error case right. need to rewrite
if strings.HasSuffix(s, "\r\n") { // Probably Windows.
  s = s[:len(s)-2]
} else if strings.HasSuffix(s, "\n") {
  s = s[:len(s)-1]
}
if len(s) == 0 {
  Fatalf(...)
}
return s
Sign in to reply to this message.

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