mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
src/pkg/[a-m]*: gofix -r error -force=error
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5322051
This commit is contained in:
parent
68050ac76b
commit
c2049d2dfe
283 changed files with 2323 additions and 2464 deletions
|
|
@ -12,7 +12,6 @@ import (
|
|||
"flag"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
|
@ -20,7 +19,7 @@ import (
|
|||
|
||||
type zeroSource struct{}
|
||||
|
||||
func (zeroSource) Read(b []byte) (n int, err os.Error) {
|
||||
func (zeroSource) Read(b []byte) (n int, err error) {
|
||||
for i := range b {
|
||||
b[i] = 0
|
||||
}
|
||||
|
|
@ -41,7 +40,7 @@ func init() {
|
|||
testConfig.InsecureSkipVerify = true
|
||||
}
|
||||
|
||||
func testClientHelloFailure(t *testing.T, m handshakeMessage, expected os.Error) {
|
||||
func testClientHelloFailure(t *testing.T, m handshakeMessage, expected error) {
|
||||
// Create in-memory network connection,
|
||||
// send message to server. Should return
|
||||
// expected error.
|
||||
|
|
@ -56,7 +55,7 @@ func testClientHelloFailure(t *testing.T, m handshakeMessage, expected os.Error)
|
|||
}()
|
||||
err := Server(s, testConfig).Handshake()
|
||||
s.Close()
|
||||
if e, ok := err.(*net.OpError); !ok || e.Error != expected {
|
||||
if e, ok := err.(*net.OpError); !ok || e.Err != expected {
|
||||
t.Errorf("Got error: %s; expected: %s", err, expected)
|
||||
}
|
||||
}
|
||||
|
|
@ -93,7 +92,7 @@ func TestAlertForwarding(t *testing.T) {
|
|||
|
||||
err := Server(s, testConfig).Handshake()
|
||||
s.Close()
|
||||
if e, ok := err.(*net.OpError); !ok || e.Error != os.Error(alertUnknownCA) {
|
||||
if e, ok := err.(*net.OpError); !ok || e.Err != error(alertUnknownCA) {
|
||||
t.Errorf("Got error: %s; expected: %s", err, alertUnknownCA)
|
||||
}
|
||||
}
|
||||
|
|
@ -104,8 +103,8 @@ func TestClose(t *testing.T) {
|
|||
|
||||
err := Server(s, testConfig).Handshake()
|
||||
s.Close()
|
||||
if err != os.EOF {
|
||||
t.Errorf("Got error: %s; expected: %s", err, os.EOF)
|
||||
if err != io.EOF {
|
||||
t.Errorf("Got error: %s; expected: %s", err, io.EOF)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue