Commit 7e92eedc authored by Robert Griesemer's avatar Robert Griesemer

gofmt'ed various stragglers

R=rsc
http://go/go-review/1022002
parent 183edddb
This diff is collapsed.
...@@ -152,7 +152,7 @@ func walk(path string, d *os.Dir, v Visitor, errors chan<- os.Error) { ...@@ -152,7 +152,7 @@ func walk(path string, d *os.Dir, v Visitor, errors chan<- os.Error) {
} }
if !v.VisitDir(path, d) { if !v.VisitDir(path, d) {
return; // skip directory entries return; // skip directory entries
} }
list, err := io.ReadDir(path); list, err := io.ReadDir(path);
...@@ -180,7 +180,7 @@ func Walk(root string, v Visitor, errors chan<- os.Error) { ...@@ -180,7 +180,7 @@ func Walk(root string, v Visitor, errors chan<- os.Error) {
if errors != nil { if errors != nil {
errors <- err; errors <- err;
} }
return; // can't progress return; // can't progress
} }
walk(root, d, v, errors); walk(root, d, v, errors);
} }
...@@ -17,26 +17,26 @@ import ( ...@@ -17,26 +17,26 @@ import (
// Call represents an active RPC. // Call represents an active RPC.
type Call struct { type Call struct {
ServiceMethod string; // The name of the service and method to call. ServiceMethod string; // The name of the service and method to call.
Args interface{}; // The argument to the function (*struct). Args interface{}; // The argument to the function (*struct).
Reply interface{}; // The reply from the function (*struct). Reply interface{}; // The reply from the function (*struct).
Error os.Error; // After completion, the error status. Error os.Error; // After completion, the error status.
Done chan *Call; // Strobes when call is complete; value is the error status. Done chan *Call; // Strobes when call is complete; value is the error status.
seq uint64; seq uint64;
} }
// Client represents an RPC Client. // Client represents an RPC Client.
// There may be multiple outstanding Calls associated // There may be multiple outstanding Calls associated
// with a single Client. // with a single Client.
type Client struct { 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 shutdown os.Error; // non-nil if the client is shut down
sending sync.Mutex; sending sync.Mutex;
seq uint64; seq uint64;
conn io.ReadWriteCloser; conn io.ReadWriteCloser;
enc *gob.Encoder; enc *gob.Encoder;
dec *gob.Decoder; dec *gob.Decoder;
pending map[uint64] *Call; pending map[uint64]*Call;
} }
func (client *Client) send(c *Call) { func (client *Client) send(c *Call) {
...@@ -75,7 +75,7 @@ func (client *Client) input() { ...@@ -75,7 +75,7 @@ func (client *Client) input() {
if err == os.EOF { if err == os.EOF {
err = io.ErrUnexpectedEOF; err = io.ErrUnexpectedEOF;
} }
break break;
} }
seq := response.Seq; seq := response.Seq;
client.mutex.Lock(); client.mutex.Lock();
...@@ -106,7 +106,7 @@ func NewClient(conn io.ReadWriteCloser) *Client { ...@@ -106,7 +106,7 @@ func NewClient(conn io.ReadWriteCloser) *Client {
client.conn = conn; client.conn = conn;
client.enc = gob.NewEncoder(conn); client.enc = gob.NewEncoder(conn);
client.dec = gob.NewDecoder(conn); client.dec = gob.NewDecoder(conn);
client.pending = make(map[uint64] *Call); client.pending = make(map[uint64]*Call);
go client.input(); go client.input();
return client; return client;
} }
...@@ -115,7 +115,7 @@ func NewClient(conn io.ReadWriteCloser) *Client { ...@@ -115,7 +115,7 @@ func NewClient(conn io.ReadWriteCloser) *Client {
func DialHTTP(network, address string) (*Client, os.Error) { func DialHTTP(network, address string) (*Client, os.Error) {
conn, err := net.Dial(network, "", address); conn, err := net.Dial(network, "", address);
if err != nil { if err != nil {
return nil, err return nil, err;
} }
io.WriteString(conn, "CONNECT " + rpcPath + " HTTP/1.0\n\n"); io.WriteString(conn, "CONNECT " + rpcPath + " HTTP/1.0\n\n");
...@@ -136,7 +136,7 @@ func DialHTTP(network, address string) (*Client, os.Error) { ...@@ -136,7 +136,7 @@ func DialHTTP(network, address string) (*Client, os.Error) {
func Dial(network, address string) (*Client, os.Error) { func Dial(network, address string) (*Client, os.Error) {
conn, err := net.Dial(network, "", address); conn, err := net.Dial(network, "", address);
if err != nil { if err != nil {
return nil, err return nil, err;
} }
return NewClient(conn), nil; return NewClient(conn), nil;
} }
...@@ -170,7 +170,7 @@ func (client *Client) Go(serviceMethod string, args interface{}, reply interface ...@@ -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. // 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 { func (client *Client) Call(serviceMethod string, args interface{}, reply interface{}) os.Error {
if client.shutdown != nil { if client.shutdown != nil {
return client.shutdown return client.shutdown;
} }
call := <-client.Go(serviceMethod, args, reply, nil).Done; call := <-client.Go(serviceMethod, args, reply, nil).Done;
return call.Error; return call.Error;
......
...@@ -291,40 +291,40 @@ var tests = []entry{ ...@@ -291,40 +291,40 @@ var tests = []entry{
"9a", "9a",
0, 0, '.', 0, 0, 0, '.', 0,
"1\t2\t3\t4\n" "1\t2\t3\t4\n"
"11\t222\t3333\t44444\n", "11\t222\t3333\t44444\n",
"1.2..3...4\n" "1.2..3...4\n"
"11222333344444\n", "11222333344444\n",
}, },
entry{ entry{
"9b", "9b",
0, 0, '.', FilterHTML, 0, 0, '.', FilterHTML,
"1\t2<!---\f--->\t3\t4\n" // \f inside HTML is ignored "1\t2<!---\f--->\t3\t4\n" // \f inside HTML is ignored
"11\t222\t3333\t44444\n", "11\t222\t3333\t44444\n",
"1.2<!---\f--->..3...4\n" "1.2<!---\f--->..3...4\n"
"11222333344444\n", "11222333344444\n",
}, },
entry{ entry{
"9c", "9c",
0, 0, '.', 0, 0, 0, '.', 0,
"1\t2\t3\t4\f" // \f causes a newline and flush "1\t2\t3\t4\f" // \f causes a newline and flush
"11\t222\t3333\t44444\n", "11\t222\t3333\t44444\n",
"1234\n" "1234\n"
"11222333344444\n", "11222333344444\n",
}, },
entry{ entry{
"9c debug", "9c debug",
0, 0, '.', Debug, 0, 0, '.', Debug,
"1\t2\t3\t4\f" // \f causes a newline and flush "1\t2\t3\t4\f" // \f causes a newline and flush
"11\t222\t3333\t44444\n", "11\t222\t3333\t44444\n",
"1|2|3|4\n" "1|2|3|4\n"
"11|222|3333|44444\n", "11|222|3333|44444\n",
}, },
entry{ entry{
...@@ -345,144 +345,144 @@ var tests = []entry{ ...@@ -345,144 +345,144 @@ var tests = []entry{
"11", "11",
8, 1, '.', 0, 8, 1, '.', 0,
"本\tb\tc\n" "本\tb\tc\n"
"aa\t\u672c\u672c\u672c\tcccc\tddddd\n" "aa\t\u672c\u672c\u672c\tcccc\tddddd\n"
"aaa\tbbbb\n", "aaa\tbbbb\n",
"本.......b.......c\n" "本.......b.......c\n"
"aa......本本本.....cccc....ddddd\n" "aa......本本本.....cccc....ddddd\n"
"aaa.....bbbb\n", "aaa.....bbbb\n",
}, },
entry{ entry{
"12a", "12a",
8, 1, ' ', AlignRight, 8, 1, ' ', AlignRight,
"a\tè\tc\t\n" "a\tè\tc\t\n"
"aa\tèèè\tcccc\tddddd\t\n" "aa\tèèè\tcccc\tddddd\t\n"
"aaa\tèèèè\t\n", "aaa\tèèèè\t\n",
" a è c\n" " a è c\n"
" aa èèè cccc ddddd\n" " aa èèè cccc ddddd\n"
" aaa èèèè\n", " aaa èèèè\n",
}, },
entry{ entry{
"12b", "12b",
2, 0, ' ', 0, 2, 0, ' ', 0,
"a\tb\tc\n" "a\tb\tc\n"
"aa\tbbb\tcccc\n" "aa\tbbb\tcccc\n"
"aaa\tbbbb\n", "aaa\tbbbb\n",
"a b c\n" "a b c\n"
"aa bbbcccc\n" "aa bbbcccc\n"
"aaabbbb\n", "aaabbbb\n",
}, },
entry{ entry{
"12c", "12c",
8, 1, '_', 0, 8, 1, '_', 0,
"a\tb\tc\n" "a\tb\tc\n"
"aa\tbbb\tcccc\n" "aa\tbbb\tcccc\n"
"aaa\tbbbb\n", "aaa\tbbbb\n",
"a_______b_______c\n" "a_______b_______c\n"
"aa______bbb_____cccc\n" "aa______bbb_____cccc\n"
"aaa_____bbbb\n", "aaa_____bbbb\n",
}, },
entry{ entry{
"13a", "13a",
4, 1, '-', 0, 4, 1, '-', 0,
"4444\t日本語\t22\t1\t333\n" "4444\t日本語\t22\t1\t333\n"
"999999999\t22\n" "999999999\t22\n"
"7\t22\n" "7\t22\n"
"\t\t\t88888888\n" "\t\t\t88888888\n"
"\n" "\n"
"666666\t666666\t666666\t4444\n" "666666\t666666\t666666\t4444\n"
"1\t1\t999999999\t0000000000\n", "1\t1\t999999999\t0000000000\n",
"4444------日本語-22--1---333\n" "4444------日本語-22--1---333\n"
"999999999-22\n" "999999999-22\n"
"7---------22\n" "7---------22\n"
"------------------88888888\n" "------------------88888888\n"
"\n" "\n"
"666666-666666-666666----4444\n" "666666-666666-666666----4444\n"
"1------1------999999999-0000000000\n", "1------1------999999999-0000000000\n",
}, },
entry{ entry{
"13b", "13b",
4, 3, '.', 0, 4, 3, '.', 0,
"4444\t333\t22\t1\t333\n" "4444\t333\t22\t1\t333\n"
"999999999\t22\n" "999999999\t22\n"
"7\t22\n" "7\t22\n"
"\t\t\t88888888\n" "\t\t\t88888888\n"
"\n" "\n"
"666666\t666666\t666666\t4444\n" "666666\t666666\t666666\t4444\n"
"1\t1\t999999999\t0000000000\n", "1\t1\t999999999\t0000000000\n",
"4444........333...22...1...333\n" "4444........333...22...1...333\n"
"999999999...22\n" "999999999...22\n"
"7...........22\n" "7...........22\n"
"....................88888888\n" "....................88888888\n"
"\n" "\n"
"666666...666666...666666......4444\n" "666666...666666...666666......4444\n"
"1........1........999999999...0000000000\n", "1........1........999999999...0000000000\n",
}, },
entry{ entry{
"13c", "13c",
8, 1, '\t', FilterHTML, 8, 1, '\t', FilterHTML,
"4444\t333\t22\t1\t333\n" "4444\t333\t22\t1\t333\n"
"999999999\t22\n" "999999999\t22\n"
"7\t22\n" "7\t22\n"
"\t\t\t88888888\n" "\t\t\t88888888\n"
"\n" "\n"
"666666\t666666\t666666\t4444\n" "666666\t666666\t666666\t4444\n"
"1\t1\t<font color=red attr=日本語>999999999</font>\t0000000000\n", "1\t1\t<font color=red attr=日本語>999999999</font>\t0000000000\n",
"4444\t\t333\t22\t1\t333\n" "4444\t\t333\t22\t1\t333\n"
"999999999\t22\n" "999999999\t22\n"
"7\t\t22\n" "7\t\t22\n"
"\t\t\t\t88888888\n" "\t\t\t\t88888888\n"
"\n" "\n"
"666666\t666666\t666666\t\t4444\n" "666666\t666666\t666666\t\t4444\n"
"1\t1\t<font color=red attr=日本語>999999999</font>\t0000000000\n", "1\t1\t<font color=red attr=日本語>999999999</font>\t0000000000\n",
}, },
entry{ entry{
"14", "14",
0, 2, ' ', AlignRight, 0, 2, ' ', AlignRight,
".0\t.3\t2.4\t-5.1\t\n" ".0\t.3\t2.4\t-5.1\t\n"
"23.0\t12345678.9\t2.4\t-989.4\t\n" "23.0\t12345678.9\t2.4\t-989.4\t\n"
"5.1\t12.0\t2.4\t-7.0\t\n" "5.1\t12.0\t2.4\t-7.0\t\n"
".0\t0.0\t332.0\t8908.0\t\n" ".0\t0.0\t332.0\t8908.0\t\n"
".0\t-.3\t456.4\t22.1\t\n" ".0\t-.3\t456.4\t22.1\t\n"
".0\t1.2\t44.4\t-13.3\t\t", ".0\t1.2\t44.4\t-13.3\t\t",
" .0 .3 2.4 -5.1\n" " .0 .3 2.4 -5.1\n"
" 23.0 12345678.9 2.4 -989.4\n" " 23.0 12345678.9 2.4 -989.4\n"
" 5.1 12.0 2.4 -7.0\n" " 5.1 12.0 2.4 -7.0\n"
" .0 0.0 332.0 8908.0\n" " .0 0.0 332.0 8908.0\n"
" .0 -.3 456.4 22.1\n" " .0 -.3 456.4 22.1\n"
" .0 1.2 44.4 -13.3", " .0 1.2 44.4 -13.3",
}, },
entry{ entry{
"14 debug", "14 debug",
0, 2, ' ', AlignRight | Debug, 0, 2, ' ', AlignRight | Debug,
".0\t.3\t2.4\t-5.1\t\n" ".0\t.3\t2.4\t-5.1\t\n"
"23.0\t12345678.9\t2.4\t-989.4\t\n" "23.0\t12345678.9\t2.4\t-989.4\t\n"
"5.1\t12.0\t2.4\t-7.0\t\n" "5.1\t12.0\t2.4\t-7.0\t\n"
".0\t0.0\t332.0\t8908.0\t\n" ".0\t0.0\t332.0\t8908.0\t\n"
".0\t-.3\t456.4\t22.1\t\n" ".0\t-.3\t456.4\t22.1\t\n"
".0\t1.2\t44.4\t-13.3\t\t", ".0\t1.2\t44.4\t-13.3\t\t",
" .0| .3| 2.4| -5.1|\n" " .0| .3| 2.4| -5.1|\n"
" 23.0| 12345678.9| 2.4| -989.4|\n" " 23.0| 12345678.9| 2.4| -989.4|\n"
" 5.1| 12.0| 2.4| -7.0|\n" " 5.1| 12.0| 2.4| -7.0|\n"
" .0| 0.0| 332.0| 8908.0|\n" " .0| 0.0| 332.0| 8908.0|\n"
" .0| -.3| 456.4| 22.1|\n" " .0| -.3| 456.4| 22.1|\n"
" .0| 1.2| 44.4| -13.3|", " .0| 1.2| 44.4| -13.3|",
}, },
entry{ entry{
...@@ -517,80 +517,80 @@ var tests = []entry{ ...@@ -517,80 +517,80 @@ var tests = []entry{
"16a", "16a",
100, 0, '\t', 0, 100, 0, '\t', 0,
"a\tb\t\td\n" "a\tb\t\td\n"
"a\tb\t\td\te\n" "a\tb\t\td\te\n"
"a\n" "a\n"
"a\tb\tc\td\n" "a\tb\tc\td\n"
"a\tb\tc\td\te\n", "a\tb\tc\td\te\n",
"a\tb\t\td\n" "a\tb\t\td\n"
"a\tb\t\td\te\n" "a\tb\t\td\te\n"
"a\n" "a\n"
"a\tb\tc\td\n" "a\tb\tc\td\n"
"a\tb\tc\td\te\n", "a\tb\tc\td\te\n",
}, },
entry{ entry{
"16b", "16b",
100, 0, '\t', DiscardEmptyColumns, 100, 0, '\t', DiscardEmptyColumns,
"a\vb\v\vd\n" "a\vb\v\vd\n"
"a\vb\v\vd\ve\n" "a\vb\v\vd\ve\n"
"a\n" "a\n"
"a\vb\vc\vd\n" "a\vb\vc\vd\n"
"a\vb\vc\vd\ve\n", "a\vb\vc\vd\ve\n",
"a\tb\td\n" "a\tb\td\n"
"a\tb\td\te\n" "a\tb\td\te\n"
"a\n" "a\n"
"a\tb\tc\td\n" "a\tb\tc\td\n"
"a\tb\tc\td\te\n", "a\tb\tc\td\te\n",
}, },
entry{ entry{
"16b debug", "16b debug",
100, 0, '\t', DiscardEmptyColumns | Debug, 100, 0, '\t', DiscardEmptyColumns | Debug,
"a\vb\v\vd\n" "a\vb\v\vd\n"
"a\vb\v\vd\ve\n" "a\vb\v\vd\ve\n"
"a\n" "a\n"
"a\vb\vc\vd\n" "a\vb\vc\vd\n"
"a\vb\vc\vd\ve\n", "a\vb\vc\vd\ve\n",
"a\t|b\t||d\n" "a\t|b\t||d\n"
"a\t|b\t||d\t|e\n" "a\t|b\t||d\t|e\n"
"a\n" "a\n"
"a\t|b\t|c\t|d\n" "a\t|b\t|c\t|d\n"
"a\t|b\t|c\t|d\t|e\n", "a\t|b\t|c\t|d\t|e\n",
}, },
entry{ entry{
"16c", "16c",
100, 0, '\t', DiscardEmptyColumns, 100, 0, '\t', DiscardEmptyColumns,
"a\tb\t\td\n" // hard tabs - do not discard column "a\tb\t\td\n" // hard tabs - do not discard column
"a\tb\t\td\te\n" "a\tb\t\td\te\n"
"a\n" "a\n"
"a\tb\tc\td\n" "a\tb\tc\td\n"
"a\tb\tc\td\te\n", "a\tb\tc\td\te\n",
"a\tb\t\td\n" "a\tb\t\td\n"
"a\tb\t\td\te\n" "a\tb\t\td\te\n"
"a\n" "a\n"
"a\tb\tc\td\n" "a\tb\tc\td\n"
"a\tb\tc\td\te\n", "a\tb\tc\td\te\n",
}, },
entry{ entry{
"16c debug", "16c debug",
100, 0, '\t', DiscardEmptyColumns | Debug, 100, 0, '\t', DiscardEmptyColumns | Debug,
"a\tb\t\td\n" // hard tabs - do not discard column "a\tb\t\td\n" // hard tabs - do not discard column
"a\tb\t\td\te\n" "a\tb\t\td\te\n"
"a\n" "a\n"
"a\tb\tc\td\n" "a\tb\tc\td\n"
"a\tb\tc\td\te\n", "a\tb\tc\td\te\n",
"a\t|b\t|\t|d\n" "a\t|b\t|\t|d\n"
"a\t|b\t|\t|d\t|e\n" "a\t|b\t|\t|d\t|e\n"
"a\n" "a\n"
"a\t|b\t|c\t|d\n" "a\t|b\t|c\t|d\n"
"a\t|b\t|c\t|d\t|e\n", "a\t|b\t|c\t|d\t|e\n",
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment