summaryrefslogtreecommitdiff
path: root/libgo/go/http/client_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/http/client_test.go')
-rw-r--r--libgo/go/http/client_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/libgo/go/http/client_test.go b/libgo/go/http/client_test.go
index 8f61286c46a..fdad2cdf540 100644
--- a/libgo/go/http/client_test.go
+++ b/libgo/go/http/client_test.go
@@ -8,13 +8,13 @@ package http_test
import (
"crypto/tls"
+ "errors"
"fmt"
. "http"
"http/httptest"
"io"
"io/ioutil"
"net"
- "os"
"strconv"
"strings"
"testing"
@@ -60,9 +60,9 @@ type recordingTransport struct {
req *Request
}
-func (t *recordingTransport) RoundTrip(req *Request) (resp *Response, err os.Error) {
+func (t *recordingTransport) RoundTrip(req *Request) (resp *Response, err error) {
t.req = req
- return nil, os.NewError("dummy impl")
+ return nil, errors.New("dummy impl")
}
func TestGetRequestFormat(t *testing.T) {
@@ -185,9 +185,9 @@ func TestRedirects(t *testing.T) {
t.Errorf("with default client Do, expected error %q, got %q", e, g)
}
- var checkErr os.Error
+ var checkErr error
var lastVia []*Request
- c = &Client{CheckRedirect: func(_ *Request, via []*Request) os.Error {
+ c = &Client{CheckRedirect: func(_ *Request, via []*Request) error {
lastVia = via
return checkErr
}}
@@ -203,7 +203,7 @@ func TestRedirects(t *testing.T) {
t.Errorf("expected lastVia to have contained %d elements; got %d", e, g)
}
- checkErr = os.NewError("no redirects allowed")
+ checkErr = errors.New("no redirects allowed")
res, err = c.Get(ts.URL)
finalUrl = res.Request.URL.String()
if e, g := "Get /?n=1: no redirects allowed", fmt.Sprintf("%v", err); e != g {
@@ -244,7 +244,7 @@ func TestStreamingGet(t *testing.T) {
}
close(say)
_, err = io.ReadFull(res.Body, buf[0:1])
- if err != os.EOF {
+ if err != io.EOF {
t.Fatalf("at end expected EOF, got %v", err)
}
}
@@ -254,7 +254,7 @@ type writeCountingConn struct {
count *int
}
-func (c *writeCountingConn) Write(p []byte) (int, os.Error) {
+func (c *writeCountingConn) Write(p []byte) (int, error) {
*c.count++
return c.Conn.Write(p)
}
@@ -267,7 +267,7 @@ func TestClientWrites(t *testing.T) {
defer ts.Close()
writes := 0
- dialer := func(netz string, addr string) (net.Conn, os.Error) {
+ dialer := func(netz string, addr string) (net.Conn, error) {
c, err := net.Dial(netz, addr)
if err == nil {
c = &writeCountingConn{c, &writes}