Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ddd0fa17
Commit
ddd0fa17
authored
Apr 08, 2011
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gotest: Fix fix for \r\n on windows.
R=rsc, brainman, rh, r2 CC=golang-dev
https://golang.org/cl/4366045
parent
db5c5d6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
src/cmd/gotest/gotest.go
src/cmd/gotest/gotest.go
+5
-6
No files found.
src/cmd/gotest/gotest.go
View file @
ddd0fa17
...
@@ -234,14 +234,13 @@ func run(args ...string) {
...
@@ -234,14 +234,13 @@ func run(args ...string) {
// runWithStdout is like run, but returns the text of standard output with the last newline dropped.
// runWithStdout is like run, but returns the text of standard output with the last newline dropped.
func
runWithStdout
(
argv
...
string
)
string
{
func
runWithStdout
(
argv
...
string
)
string
{
s
:=
doRun
(
argv
,
true
)
s
:=
doRun
(
argv
,
true
)
if
len
(
s
)
==
0
{
if
strings
.
HasSuffix
(
s
,
"
\r\n
"
)
{
Fatalf
(
"no output from command %s"
,
strings
.
Join
(
argv
,
" "
))
s
=
s
[
:
len
(
s
)
-
2
]
}
}
else
if
strings
.
HasSuffix
(
s
,
"
\n
"
)
{
if
s
[
len
(
s
)
-
1
]
==
'\n'
{
s
=
s
[
:
len
(
s
)
-
1
]
s
=
s
[
:
len
(
s
)
-
1
]
}
}
if
len
(
s
)
>
0
&&
s
[
len
(
s
)
-
1
]
==
'\r'
{
// it is \r\n on Windows.
if
len
(
s
)
==
0
{
s
=
s
[
:
len
(
s
)
-
1
]
Fatalf
(
"no output from command %s"
,
strings
.
Join
(
argv
,
" "
))
}
}
return
s
return
s
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment