aboutsummaryrefslogtreecommitdiff
path: root/server_timing_test.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2022-04-01 18:11:16 +0200
committerGravatar GitHub <noreply@github.com> 2022-04-01 18:11:16 +0200
commit7a5afddf5b805a022f8e81281c772c11600da2f4 (patch)
tree76ecbf4981921328d823eb925e57f874f52c34f2 /server_timing_test.go
parentsupport adding/removing clients from LBClient (#1243) (diff)
downloadfasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.tar.gz
fasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.tar.bz2
fasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.zip
Use %v for errors and %q for strings (#1262)v1.35.0
Mostly in tests.
Diffstat (limited to 'server_timing_test.go')
-rw-r--r--server_timing_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/server_timing_test.go b/server_timing_test.go
index 1e7f6f2..0f2d4a7 100644
--- a/server_timing_test.go
+++ b/server_timing_test.go
@@ -320,7 +320,7 @@ var (
"Referer: http://example.com/aaa?bbb=ccc\r\nCookie: foo=bar; baz=baraz; aa=aakslsdweriwereowriewroire\r\n\r\n"
postRequest = fmt.Sprintf("POST /foobar?baz HTTP/1.1\r\nHost: google.com\r\nContent-Type: foo/bar\r\nContent-Length: %d\r\n"+
"User-Agent: Opera Chrome MSIE Firefox and other/1.2.34\r\nReferer: http://google.com/aaaa/bbb/ccc\r\n"+
- "Cookie: foo=bar; baz=baraz; aa=aakslsdweriwereowriewroire\r\n\r\n%s",
+ "Cookie: foo=bar; baz=baraz; aa=aakslsdweriwereowriewroire\r\n\r\n%q",
len(fakeResponse), fakeResponse)
)
@@ -329,7 +329,7 @@ func benchmarkServerGet(b *testing.B, clientsCount, requestsPerConn int) {
s := &Server{
Handler: func(ctx *RequestCtx) {
if !ctx.IsGet() {
- b.Fatalf("Unexpected request method: %s", ctx.Method())
+ b.Fatalf("Unexpected request method: %q", ctx.Method())
}
ctx.Success("text/plain", fakeResponse)
if requestsPerConn == 1 {
@@ -348,7 +348,7 @@ func benchmarkNetHTTPServerGet(b *testing.B, clientsCount, requestsPerConn int)
s := &http.Server{
Handler: http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
if req.Method != MethodGet {
- b.Fatalf("Unexpected request method: %s", req.Method)
+ b.Fatalf("Unexpected request method: %q", req.Method)
}
h := w.Header()
h.Set("Content-Type", "text/plain")
@@ -368,7 +368,7 @@ func benchmarkServerPost(b *testing.B, clientsCount, requestsPerConn int) {
s := &Server{
Handler: func(ctx *RequestCtx) {
if !ctx.IsPost() {
- b.Fatalf("Unexpected request method: %s", ctx.Method())
+ b.Fatalf("Unexpected request method: %q", ctx.Method())
}
body := ctx.Request.Body()
if !bytes.Equal(body, fakeResponse) {
@@ -391,11 +391,11 @@ func benchmarkNetHTTPServerPost(b *testing.B, clientsCount, requestsPerConn int)
s := &http.Server{
Handler: http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
if req.Method != MethodPost {
- b.Fatalf("Unexpected request method: %s", req.Method)
+ b.Fatalf("Unexpected request method: %q", req.Method)
}
body, err := ioutil.ReadAll(req.Body)
if err != nil {
- b.Fatalf("Unexpected error: %s", err)
+ b.Fatalf("Unexpected error: %v", err)
}
req.Body.Close()
if !bytes.Equal(body, fakeResponse) {