Skip to content

Commit

Permalink
Format errors (#679)
Browse files Browse the repository at this point in the history
* format errors

* Server is a type name

* Fix typo
  • Loading branch information
zhangyunhao116 authored and erikdubbelboer committed Oct 23, 2019
1 parent 18c619f commit 707b1c1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func TestArgsSetGetDel(t *testing.T) {

a.Parse("aaa=xxx&bb=aa")
if string(a.Peek("foo0")) != "" {
t.Fatalf("Unepxected value %q", a.Peek("foo0"))
t.Fatalf("Unexpected value %q", a.Peek("foo0"))
}
if string(a.Peek("aaa")) != "xxx" {
t.Fatalf("Unexpected value %q. Expected %q", a.Peek("aaa"), "xxx")
Expand Down
2 changes: 1 addition & 1 deletion bytesconv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func testAppendIPv4(t *testing.T, ipStr string, isValid bool) {
s := string(AppendIPv4(nil, ip))
if isValid {
if s != ipStr {
t.Fatalf("unepxected ip %q. Expecting %q", s, ipStr)
t.Fatalf("unexpected ip %q. Expecting %q", s, ipStr)
}
} else {
ipStr = "non-v4 ip passed to AppendIPv4"
Expand Down
8 changes: 4 additions & 4 deletions header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ func TestResponseHeaderVisitAll(t *testing.T) {
r := bytes.NewBufferString("HTTP/1.1 200 OK\r\nContent-Type: aa\r\nContent-Length: 123\r\nSet-Cookie: aa=bb; path=/foo/bar\r\nSet-Cookie: ccc\r\n\r\n")
br := bufio.NewReader(r)
if err := h.Read(br); err != nil {
t.Fatalf("Unepxected error: %s", err)
t.Fatalf("Unexpected error: %s", err)
}

if h.Len() != 4 {
Expand Down Expand Up @@ -1378,11 +1378,11 @@ func TestRequestHeaderVisitAll(t *testing.T) {
}
cookieCount++
default:
t.Fatalf("Unepxected header %q=%q", k, v)
t.Fatalf("Unexpected header %q=%q", k, v)
}
})
if hostCount != 1 {
t.Fatalf("Unepxected number of host headers detected %d. Expected 1", hostCount)
t.Fatalf("Unexpected number of host headers detected %d. Expected 1", hostCount)
}
if xxCount != 2 {
t.Fatalf("Unexpected number of xx headers detected %d. Expected 2", xxCount)
Expand All @@ -1400,7 +1400,7 @@ func TestResponseHeaderVisitAllInOrder(t *testing.T) {
r := bytes.NewBufferString("GET / HTTP/1.1\r\nContent-Type: aa\r\nCookie: a=b\r\nHost: example.com\r\nUser-Agent: xxx\r\n\r\n")
br := bufio.NewReader(r)
if err := h.Read(br); err != nil {
t.Fatalf("Unepxected error: %s", err)
t.Fatalf("Unexpected error: %s", err)
}

if h.Len() != 4 {
Expand Down
2 changes: 1 addition & 1 deletion reuseport/reuseport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func serveEcho(t *testing.T, ln net.Listener) {
}
req, err := ioutil.ReadAll(c)
if err != nil {
t.Fatalf("unepxected error when reading request: %s", err)
t.Fatalf("unexpected error when reading request: %s", err)
}
if _, err = c.Write(req); err != nil {
t.Fatalf("unexpected error when writing response: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"time"
)

var errNoCertOrKeyProvided = errors.New("Cert or key has not provided")
var errNoCertOrKeyProvided = errors.New("cert or key has not provided")

var (
// ErrAlreadyServing is returned when calling Serve on a Server
Expand Down
2 changes: 1 addition & 1 deletion stackless/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func testWriter(newWriter NewWriterFunc, newReader func(io.Reader) io.Reader) er

for i := 0; i < 5; i++ {
if err := testWriterReuse(w, dstW, newReader); err != nil {
return fmt.Errorf("unepxected error when re-using writer on iteration %d: %s", i, err)
return fmt.Errorf("unexpected error when re-using writer on iteration %d: %s", i, err)
}
dstW = &bytes.Buffer{}
w.Reset(dstW)
Expand Down

0 comments on commit 707b1c1

Please sign in to comment.