Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
7e92eedc
Commit
7e92eedc
authored
Nov 06, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt'ed various stragglers
R=rsc
http://go/go-review/1022002
parent
183edddb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
140 deletions
+140
-140
patch_test.go
src/pkg/patch/patch_test.go
+0
-0
path.go
src/pkg/path/path.go
+2
-2
client.go
src/pkg/rpc/client.go
+18
-18
tabwriter_test.go
src/pkg/tabwriter/tabwriter_test.go
+120
-120
No files found.
src/pkg/patch/patch_test.go
View file @
7e92eedc
This diff is collapsed.
Click to expand it.
src/pkg/path/path.go
View file @
7e92eedc
...
...
@@ -152,7 +152,7 @@ func walk(path string, d *os.Dir, v Visitor, errors chan<- os.Error) {
}
if
!
v
.
VisitDir
(
path
,
d
)
{
return
;
// skip directory entries
return
;
// skip directory entries
}
list
,
err
:=
io
.
ReadDir
(
path
);
...
...
@@ -180,7 +180,7 @@ func Walk(root string, v Visitor, errors chan<- os.Error) {
if
errors
!=
nil
{
errors
<-
err
;
}
return
;
// can't progress
return
;
// can't progress
}
walk
(
root
,
d
,
v
,
errors
);
}
src/pkg/rpc/client.go
View file @
7e92eedc
...
...
@@ -17,26 +17,26 @@ import (
// Call represents an active RPC.
type
Call
struct
{
ServiceMethod
string
;
// The name of the service and method to call.
Args
interface
{};
// The argument to the function (*struct).
Reply
interface
{};
// The reply from the function (*struct).
Error
os
.
Error
;
// After completion, the error status.
Done
chan
*
Call
;
// Strobes when call is complete; value is the error status.
seq
uint64
;
ServiceMethod
string
;
// The name of the service and method to call.
Args
interface
{};
// The argument to the function (*struct).
Reply
interface
{};
// The reply from the function (*struct).
Error
os
.
Error
;
// After completion, the error status.
Done
chan
*
Call
;
// Strobes when call is complete; value is the error status.
seq
uint64
;
}
// Client represents an RPC Client.
// There may be multiple outstanding Calls associated
// with a single Client.
type
Client
struct
{
mutex
sync
.
Mutex
;
// protects pending, seq
mutex
sync
.
Mutex
;
// protects pending, seq
shutdown
os
.
Error
;
// non-nil if the client is shut down
sending
sync
.
Mutex
;
seq
uint64
;
conn
io
.
ReadWriteCloser
;
enc
*
gob
.
Encoder
;
dec
*
gob
.
Decoder
;
pending
map
[
uint64
]
*
Call
;
sending
sync
.
Mutex
;
seq
uint64
;
conn
io
.
ReadWriteCloser
;
enc
*
gob
.
Encoder
;
dec
*
gob
.
Decoder
;
pending
map
[
uint64
]
*
Call
;
}
func
(
client
*
Client
)
send
(
c
*
Call
)
{
...
...
@@ -75,7 +75,7 @@ func (client *Client) input() {
if
err
==
os
.
EOF
{
err
=
io
.
ErrUnexpectedEOF
;
}
break
break
;
}
seq
:=
response
.
Seq
;
client
.
mutex
.
Lock
();
...
...
@@ -106,7 +106,7 @@ func NewClient(conn io.ReadWriteCloser) *Client {
client
.
conn
=
conn
;
client
.
enc
=
gob
.
NewEncoder
(
conn
);
client
.
dec
=
gob
.
NewDecoder
(
conn
);
client
.
pending
=
make
(
map
[
uint64
]
*
Call
);
client
.
pending
=
make
(
map
[
uint64
]
*
Call
);
go
client
.
input
();
return
client
;
}
...
...
@@ -115,7 +115,7 @@ func NewClient(conn io.ReadWriteCloser) *Client {
func
DialHTTP
(
network
,
address
string
)
(
*
Client
,
os
.
Error
)
{
conn
,
err
:=
net
.
Dial
(
network
,
""
,
address
);
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
;
}
io
.
WriteString
(
conn
,
"CONNECT "
+
rpcPath
+
" HTTP/1.0
\n\n
"
);
...
...
@@ -136,7 +136,7 @@ func DialHTTP(network, address string) (*Client, os.Error) {
func
Dial
(
network
,
address
string
)
(
*
Client
,
os
.
Error
)
{
conn
,
err
:=
net
.
Dial
(
network
,
""
,
address
);
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
;
}
return
NewClient
(
conn
),
nil
;
}
...
...
@@ -170,7 +170,7 @@ func (client *Client) Go(serviceMethod string, args interface{}, reply interface
// Call invokes the named function, waits for it to complete, and returns its error status.
func
(
client
*
Client
)
Call
(
serviceMethod
string
,
args
interface
{},
reply
interface
{})
os
.
Error
{
if
client
.
shutdown
!=
nil
{
return
client
.
shutdown
return
client
.
shutdown
;
}
call
:=
<-
client
.
Go
(
serviceMethod
,
args
,
reply
,
nil
)
.
Done
;
return
call
.
Error
;
...
...
src/pkg/tabwriter/tabwriter_test.go
View file @
7e92eedc
...
...
@@ -291,40 +291,40 @@ var tests = []entry{
"9a"
,
0
,
0
,
'.'
,
0
,
"1
\t
2
\t
3
\t
4
\n
"
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1.2..3...4
\n
"
"11222333344444
\n
"
,
"11222333344444
\n
"
,
},
entry
{
"9b"
,
0
,
0
,
'.'
,
FilterHTML
,
"1
\t
2<!---
\f
--->
\t
3
\t
4
\n
"
// \f inside HTML is ignored
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1.2<!---
\f
--->..3...4
\n
"
"11222333344444
\n
"
,
"11222333344444
\n
"
,
},
entry
{
"9c"
,
0
,
0
,
'.'
,
0
,
"1
\t
2
\t
3
\t
4
\f
"
// \f causes a newline and flush
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1234
\n
"
"11222333344444
\n
"
,
"11222333344444
\n
"
,
},
entry
{
"9c debug"
,
0
,
0
,
'.'
,
Debug
,
"1
\t
2
\t
3
\t
4
\f
"
// \f causes a newline and flush
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1|2|3|4
\n
"
"11|222|3333|44444
\n
"
,
"11|222|3333|44444
\n
"
,
},
entry
{
...
...
@@ -345,144 +345,144 @@ var tests = []entry{
"11"
,
8
,
1
,
'.'
,
0
,
"本
\t
b
\t
c
\n
"
"aa
\t\u672c\u672c\u672c\t
cccc
\t
ddddd
\n
"
"aaa
\t
bbbb
\n
"
,
"aa
\t\u672c\u672c\u672c\t
cccc
\t
ddddd
\n
"
"aaa
\t
bbbb
\n
"
,
"本.......b.......c
\n
"
"aa......本本本.....cccc....ddddd
\n
"
"aaa.....bbbb
\n
"
,
"aa......本本本.....cccc....ddddd
\n
"
"aaa.....bbbb
\n
"
,
},
entry
{
"12a"
,
8
,
1
,
' '
,
AlignRight
,
"a
\t
è
\t
c
\t\n
"
"aa
\t
èèè
\t
cccc
\t
ddddd
\t\n
"
"aaa
\t
èèèè
\t\n
"
,
"aa
\t
èèè
\t
cccc
\t
ddddd
\t\n
"
"aaa
\t
èèèè
\t\n
"
,
" a è c
\n
"
" aa èèè cccc ddddd
\n
"
" aaa èèèè
\n
"
,
" aa èèè cccc ddddd
\n
"
" aaa èèèè
\n
"
,
},
entry
{
"12b"
,
2
,
0
,
' '
,
0
,
"a
\t
b
\t
c
\n
"
"aa
\t
bbb
\t
cccc
\n
"
"aaa
\t
bbbb
\n
"
,
"aa
\t
bbb
\t
cccc
\n
"
"aaa
\t
bbbb
\n
"
,
"a b c
\n
"
"aa bbbcccc
\n
"
"aaabbbb
\n
"
,
"aa bbbcccc
\n
"
"aaabbbb
\n
"
,
},
entry
{
"12c"
,
8
,
1
,
'_'
,
0
,
"a
\t
b
\t
c
\n
"
"aa
\t
bbb
\t
cccc
\n
"
"aaa
\t
bbbb
\n
"
,
"aa
\t
bbb
\t
cccc
\n
"
"aaa
\t
bbbb
\n
"
,
"a_______b_______c
\n
"
"aa______bbb_____cccc
\n
"
"aaa_____bbbb
\n
"
,
"aa______bbb_____cccc
\n
"
"aaa_____bbbb
\n
"
,
},
entry
{
"13a"
,
4
,
1
,
'-'
,
0
,
"4444
\t
日本語
\t
22
\t
1
\t
333
\n
"
"999999999
\t
22
\n
"
"7
\t
22
\n
"
"
\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t
4444
\n
"
"1
\t
1
\t
999999999
\t
0000000000
\n
"
,
"999999999
\t
22
\n
"
"7
\t
22
\n
"
"
\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t
4444
\n
"
"1
\t
1
\t
999999999
\t
0000000000
\n
"
,
"4444------日本語-22--1---333
\n
"
"999999999-22
\n
"
"7---------22
\n
"
"------------------88888888
\n
"
"
\n
"
"666666-666666-666666----4444
\n
"
"1------1------999999999-0000000000
\n
"
,
"999999999-22
\n
"
"7---------22
\n
"
"------------------88888888
\n
"
"
\n
"
"666666-666666-666666----4444
\n
"
"1------1------999999999-0000000000
\n
"
,
},
entry
{
"13b"
,
4
,
3
,
'.'
,
0
,
"4444
\t
333
\t
22
\t
1
\t
333
\n
"
"999999999
\t
22
\n
"
"7
\t
22
\n
"
"
\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t
4444
\n
"
"1
\t
1
\t
999999999
\t
0000000000
\n
"
,
"999999999
\t
22
\n
"
"7
\t
22
\n
"
"
\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t
4444
\n
"
"1
\t
1
\t
999999999
\t
0000000000
\n
"
,
"4444........333...22...1...333
\n
"
"999999999...22
\n
"
"7...........22
\n
"
"....................88888888
\n
"
"
\n
"
"666666...666666...666666......4444
\n
"
"1........1........999999999...0000000000
\n
"
,
"999999999...22
\n
"
"7...........22
\n
"
"....................88888888
\n
"
"
\n
"
"666666...666666...666666......4444
\n
"
"1........1........999999999...0000000000
\n
"
,
},
entry
{
"13c"
,
8
,
1
,
'\t'
,
FilterHTML
,
"4444
\t
333
\t
22
\t
1
\t
333
\n
"
"999999999
\t
22
\n
"
"7
\t
22
\n
"
"
\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t
4444
\n
"
"1
\t
1
\t
<font color=red attr=日本語>999999999</font>
\t
0000000000
\n
"
,
"999999999
\t
22
\n
"
"7
\t
22
\n
"
"
\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t
4444
\n
"
"1
\t
1
\t
<font color=red attr=日本語>999999999</font>
\t
0000000000
\n
"
,
"4444
\t\t
333
\t
22
\t
1
\t
333
\n
"
"999999999
\t
22
\n
"
"7
\t\t
22
\n
"
"
\t\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t\t
4444
\n
"
"1
\t
1
\t
<font color=red attr=日本語>999999999</font>
\t
0000000000
\n
"
,
"999999999
\t
22
\n
"
"7
\t\t
22
\n
"
"
\t\t\t\t
88888888
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t\t
4444
\n
"
"1
\t
1
\t
<font color=red attr=日本語>999999999</font>
\t
0000000000
\n
"
,
},
entry
{
"14"
,
0
,
2
,
' '
,
AlignRight
,
".0
\t
.3
\t
2.4
\t
-5.1
\t\n
"
"23.0
\t
12345678.9
\t
2.4
\t
-989.4
\t\n
"
"5.1
\t
12.0
\t
2.4
\t
-7.0
\t\n
"
".0
\t
0.0
\t
332.0
\t
8908.0
\t\n
"
".0
\t
-.3
\t
456.4
\t
22.1
\t\n
"
".0
\t
1.2
\t
44.4
\t
-13.3
\t\t
"
,
"23.0
\t
12345678.9
\t
2.4
\t
-989.4
\t\n
"
"5.1
\t
12.0
\t
2.4
\t
-7.0
\t\n
"
".0
\t
0.0
\t
332.0
\t
8908.0
\t\n
"
".0
\t
-.3
\t
456.4
\t
22.1
\t\n
"
".0
\t
1.2
\t
44.4
\t
-13.3
\t\t
"
,
" .0 .3 2.4 -5.1
\n
"
" 23.0 12345678.9 2.4 -989.4
\n
"
" 5.1 12.0 2.4 -7.0
\n
"
" .0 0.0 332.0 8908.0
\n
"
" .0 -.3 456.4 22.1
\n
"
" .0 1.2 44.4 -13.3"
,
" 23.0 12345678.9 2.4 -989.4
\n
"
" 5.1 12.0 2.4 -7.0
\n
"
" .0 0.0 332.0 8908.0
\n
"
" .0 -.3 456.4 22.1
\n
"
" .0 1.2 44.4 -13.3"
,
},
entry
{
"14 debug"
,
0
,
2
,
' '
,
AlignRight
|
Debug
,
".0
\t
.3
\t
2.4
\t
-5.1
\t\n
"
"23.0
\t
12345678.9
\t
2.4
\t
-989.4
\t\n
"
"5.1
\t
12.0
\t
2.4
\t
-7.0
\t\n
"
".0
\t
0.0
\t
332.0
\t
8908.0
\t\n
"
".0
\t
-.3
\t
456.4
\t
22.1
\t\n
"
".0
\t
1.2
\t
44.4
\t
-13.3
\t\t
"
,
"23.0
\t
12345678.9
\t
2.4
\t
-989.4
\t\n
"
"5.1
\t
12.0
\t
2.4
\t
-7.0
\t\n
"
".0
\t
0.0
\t
332.0
\t
8908.0
\t\n
"
".0
\t
-.3
\t
456.4
\t
22.1
\t\n
"
".0
\t
1.2
\t
44.4
\t
-13.3
\t\t
"
,
" .0| .3| 2.4| -5.1|
\n
"
" 23.0| 12345678.9| 2.4| -989.4|
\n
"
" 5.1| 12.0| 2.4| -7.0|
\n
"
" .0| 0.0| 332.0| 8908.0|
\n
"
" .0| -.3| 456.4| 22.1|
\n
"
" .0| 1.2| 44.4| -13.3|"
,
" 23.0| 12345678.9| 2.4| -989.4|
\n
"
" 5.1| 12.0| 2.4| -7.0|
\n
"
" .0| 0.0| 332.0| 8908.0|
\n
"
" .0| -.3| 456.4| 22.1|
\n
"
" .0| 1.2| 44.4| -13.3|"
,
},
entry
{
...
...
@@ -517,80 +517,80 @@ var tests = []entry{
"16a"
,
100
,
0
,
'\t'
,
0
,
"a
\t
b
\t\t
d
\n
"
"a
\t
b
\t\t
d
\t
e
\n
"
"a
\n
"
"a
\t
b
\t
c
\t
d
\n
"
"a
\t
b
\t
c
\t
d
\t
e
\n
"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t
|c
\t
|d
\t
|e
\n
"
,
},
}
...
...
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