From 5546cc7eabef2775d379a6cdb4f4d2926fa7ab23 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 28 Mar 2011 23:28:53 -0400 Subject: [PATCH] update tree for package net changes Converted with gofix. R=adg CC=golang-dev https://golang.org/cl/4284049 --- src/pkg/exp/draw/x11/conn.go | 6 +++--- src/pkg/http/serve_test.go | 8 ++++---- src/pkg/http/transport.go | 2 +- src/pkg/netchan/import.go | 2 +- src/pkg/rpc/client.go | 4 ++-- src/pkg/rpc/jsonrpc/client.go | 2 +- src/pkg/smtp/smtp.go | 2 +- src/pkg/syslog/syslog.go | 2 +- src/pkg/syslog/syslog_unix.go | 2 +- src/pkg/websocket/client.go | 4 ++-- src/pkg/websocket/websocket_test.go | 10 +++++----- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/pkg/exp/draw/x11/conn.go b/src/pkg/exp/draw/x11/conn.go index e28fb21706..53294af15c 100644 --- a/src/pkg/exp/draw/x11/conn.go +++ b/src/pkg/exp/draw/x11/conn.go @@ -286,11 +286,11 @@ func connect(display string) (conn net.Conn, displayStr string, err os.Error) { } // Make the connection. if socket != "" { - conn, err = net.Dial("unix", "", socket+":"+displayStr) + conn, err = net.Dial("unix", socket+":"+displayStr) } else if host != "" { - conn, err = net.Dial(protocol, "", host+":"+strconv.Itoa(6000+displayInt)) + conn, err = net.Dial(protocol, host+":"+strconv.Itoa(6000+displayInt)) } else { - conn, err = net.Dial("unix", "", "/tmp/.X11-unix/X"+displayStr) + conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+displayStr) } if err != nil { return nil, "", os.NewError("cannot connect to " + display + ": " + err.String()) diff --git a/src/pkg/http/serve_test.go b/src/pkg/http/serve_test.go index 683de85b86..b0e26e5335 100644 --- a/src/pkg/http/serve_test.go +++ b/src/pkg/http/serve_test.go @@ -175,7 +175,7 @@ func TestHostHandlers(t *testing.T) { ts := httptest.NewServer(nil) defer ts.Close() - conn, err := net.Dial("tcp", "", ts.Listener.Addr().String()) + conn, err := net.Dial("tcp", ts.Listener.Addr().String()) if err != nil { t.Fatal(err) } @@ -265,7 +265,7 @@ func TestServerTimeouts(t *testing.T) { // Slow client that should timeout. t1 := time.Nanoseconds() - conn, err := net.Dial("tcp", "", fmt.Sprintf("localhost:%d", addr.Port)) + conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%d", addr.Port)) if err != nil { t.Fatalf("Dial: %v", err) } @@ -348,7 +348,7 @@ func TestIdentityResponse(t *testing.T) { } // Verify that the connection is closed when the declared Content-Length // is larger than what the handler wrote. - conn, err := net.Dial("tcp", "", ts.Listener.Addr().String()) + conn, err := net.Dial("tcp", ts.Listener.Addr().String()) if err != nil { t.Fatalf("error dialing: %v", err) } @@ -377,7 +377,7 @@ func TestServeHTTP10Close(t *testing.T) { })) defer s.Close() - conn, err := net.Dial("tcp", "", s.Listener.Addr().String()) + conn, err := net.Dial("tcp", s.Listener.Addr().String()) if err != nil { t.Fatal("dial error:", err) } diff --git a/src/pkg/http/transport.go b/src/pkg/http/transport.go index 8a73ead31f..ed7843bc71 100644 --- a/src/pkg/http/transport.go +++ b/src/pkg/http/transport.go @@ -195,7 +195,7 @@ func (t *Transport) getConn(cm *connectMethod) (*persistConn, os.Error) { return pc, nil } - conn, err := net.Dial("tcp", "", cm.addr()) + conn, err := net.Dial("tcp", cm.addr()) if err != nil { return nil, err } diff --git a/src/pkg/netchan/import.go b/src/pkg/netchan/import.go index 5db679a3ed..8ba5df9a51 100644 --- a/src/pkg/netchan/import.go +++ b/src/pkg/netchan/import.go @@ -48,7 +48,7 @@ func NewImporter(conn io.ReadWriter) *Importer { // Import imports a set of channels from the given network and address. func Import(network, remoteaddr string) (*Importer, os.Error) { - conn, err := net.Dial(network, "", remoteaddr) + conn, err := net.Dial(network, remoteaddr) if err != nil { return nil, err } diff --git a/src/pkg/rpc/client.go b/src/pkg/rpc/client.go index 9237252117..8af4afcf69 100644 --- a/src/pkg/rpc/client.go +++ b/src/pkg/rpc/client.go @@ -208,7 +208,7 @@ func DialHTTP(network, address string) (*Client, os.Error) { // at the specified network address and path. func DialHTTPPath(network, address, path string) (*Client, os.Error) { var err os.Error - conn, err := net.Dial(network, "", address) + conn, err := net.Dial(network, address) if err != nil { return nil, err } @@ -229,7 +229,7 @@ func DialHTTPPath(network, address, path string) (*Client, os.Error) { // Dial connects to an RPC server at the specified network address. func Dial(network, address string) (*Client, os.Error) { - conn, err := net.Dial(network, "", address) + conn, err := net.Dial(network, address) if err != nil { return nil, err } diff --git a/src/pkg/rpc/jsonrpc/client.go b/src/pkg/rpc/jsonrpc/client.go index 5b806bd6e2..57e977d325 100644 --- a/src/pkg/rpc/jsonrpc/client.go +++ b/src/pkg/rpc/jsonrpc/client.go @@ -116,7 +116,7 @@ func NewClient(conn io.ReadWriteCloser) *rpc.Client { // Dial connects to a JSON-RPC server at the specified network address. func Dial(network, address string) (*rpc.Client, os.Error) { - conn, err := net.Dial(network, "", address) + conn, err := net.Dial(network, address) if err != nil { return nil, err } diff --git a/src/pkg/smtp/smtp.go b/src/pkg/smtp/smtp.go index 2f6d2f31a7..3f89af1472 100644 --- a/src/pkg/smtp/smtp.go +++ b/src/pkg/smtp/smtp.go @@ -39,7 +39,7 @@ type Client struct { // Dial returns a new Client connected to an SMTP server at addr. func Dial(addr string) (*Client, os.Error) { - conn, err := net.Dial("tcp", "", addr) + conn, err := net.Dial("tcp", addr) if err != nil { return nil, err } diff --git a/src/pkg/syslog/syslog.go b/src/pkg/syslog/syslog.go index 711d5ddc74..4ada113f1d 100644 --- a/src/pkg/syslog/syslog.go +++ b/src/pkg/syslog/syslog.go @@ -67,7 +67,7 @@ func Dial(network, raddr string, priority Priority, prefix string) (w *Writer, e conn, err = unixSyslog() } else { var c net.Conn - c, err = net.Dial(network, "", raddr) + c, err = net.Dial(network, raddr) conn = netConn{c} } return &Writer{priority, prefix, conn}, err diff --git a/src/pkg/syslog/syslog_unix.go b/src/pkg/syslog/syslog_unix.go index b4daf88ee2..fa15e882d0 100644 --- a/src/pkg/syslog/syslog_unix.go +++ b/src/pkg/syslog/syslog_unix.go @@ -19,7 +19,7 @@ func unixSyslog() (conn serverConn, err os.Error) { for _, network := range logTypes { for _, path := range logPaths { raddr = path - conn, err := net.Dial(network, "", raddr) + conn, err := net.Dial(network, raddr) if err != nil { continue } else { diff --git a/src/pkg/websocket/client.go b/src/pkg/websocket/client.go index d8a7aa0a26..78c8b7f57b 100644 --- a/src/pkg/websocket/client.go +++ b/src/pkg/websocket/client.go @@ -108,10 +108,10 @@ func Dial(url, protocol, origin string) (ws *Conn, err os.Error) { switch parsedUrl.Scheme { case "ws": - client, err = net.Dial("tcp", "", parsedUrl.Host) + client, err = net.Dial("tcp", parsedUrl.Host) case "wss": - client, err = tls.Dial("tcp", "", parsedUrl.Host, nil) + client, err = tls.Dial("tcp", parsedUrl.Host, nil) default: err = ErrBadScheme diff --git a/src/pkg/websocket/websocket_test.go b/src/pkg/websocket/websocket_test.go index 14d708a3ba..8b3cf8925a 100644 --- a/src/pkg/websocket/websocket_test.go +++ b/src/pkg/websocket/websocket_test.go @@ -53,7 +53,7 @@ func TestEcho(t *testing.T) { once.Do(startServer) // websocket.Dial() - client, err := net.Dial("tcp", "", serverAddr) + client, err := net.Dial("tcp", serverAddr) if err != nil { t.Fatal("dialing", err) } @@ -84,7 +84,7 @@ func TestEchoDraft75(t *testing.T) { once.Do(startServer) // websocket.Dial() - client, err := net.Dial("tcp", "", serverAddr) + client, err := net.Dial("tcp", serverAddr) if err != nil { t.Fatal("dialing", err) } @@ -114,7 +114,7 @@ func TestEchoDraft75(t *testing.T) { func TestWithQuery(t *testing.T) { once.Do(startServer) - client, err := net.Dial("tcp", "", serverAddr) + client, err := net.Dial("tcp", serverAddr) if err != nil { t.Fatal("dialing", err) } @@ -131,7 +131,7 @@ func TestWithQuery(t *testing.T) { func TestWithProtocol(t *testing.T) { once.Do(startServer) - client, err := net.Dial("tcp", "", serverAddr) + client, err := net.Dial("tcp", serverAddr) if err != nil { t.Fatal("dialing", err) } @@ -200,7 +200,7 @@ func TestSmallBuffer(t *testing.T) { once.Do(startServer) // websocket.Dial() - client, err := net.Dial("tcp", "", serverAddr) + client, err := net.Dial("tcp", serverAddr) if err != nil { t.Fatal("dialing", err) }