Skip to content
Permalink
Browse files

Format errors (#679)

* format errors

* Server is a type name

* Fix typo
  • Loading branch information...
ZYunH authored and erikdubbelboer committed Oct 23, 2019
1 parent 18c619f commit 707b1c1917f38038d0d81e856df73853513100b3
Showing with 9 additions and 9 deletions.
  1. +1 −1 args_test.go
  2. +1 −1 bytesconv_test.go
  3. +4 −4 header_test.go
  4. +1 −1 reuseport/reuseport_test.go
  5. +1 −1 server.go
  6. +1 −1 stackless/writer_test.go
@@ -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")
@@ -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"
@@ -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 {
@@ -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)
@@ -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 {
@@ -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)
@@ -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
@@ -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)

0 comments on commit 707b1c1

Please sign in to comment.
You can’t perform that action at this time.