From: Alex Brainman Date: Fri, 8 Apr 2011 13:53:57 +0000 (+1000) Subject: gotest: handle \r\n returned by gomake on Windows (fixes build) X-Git-Tag: weekly.2011-04-13~62 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d9763147764400c6fb7a0701a5c9cbdd6682062d;p=gostls13.git gotest: handle \r\n returned by gomake on Windows (fixes build) R=golang-dev, peterGo, rsc1 CC=Joe Poirier, golang-dev https://golang.org/cl/4370048 --- diff --git a/src/cmd/gotest/gotest.go b/src/cmd/gotest/gotest.go index 210798c63f..2455aa88f4 100644 --- a/src/cmd/gotest/gotest.go +++ b/src/cmd/gotest/gotest.go @@ -240,6 +240,9 @@ func runWithStdout(argv ...string) string { if s[len(s)-1] == '\n' { s = s[:len(s)-1] } + if len(s) > 0 && s[len(s)-1] == '\r' { // it is \r\n on Windows. + s = s[:len(s)-1] + } return s }