diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2022-04-01 18:11:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 18:11:16 +0200 |
commit | 7a5afddf5b805a022f8e81281c772c11600da2f4 (patch) | |
tree | 76ecbf4981921328d823eb925e57f874f52c34f2 /fasthttpadaptor | |
parent | support adding/removing clients from LBClient (#1243) (diff) | |
download | fasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.tar.gz fasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.tar.bz2 fasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.zip |
Mostly in tests.
Diffstat (limited to 'fasthttpadaptor')
-rw-r--r-- | fasthttpadaptor/adaptor.go | 2 | ||||
-rw-r--r-- | fasthttpadaptor/adaptor_test.go | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/fasthttpadaptor/adaptor.go b/fasthttpadaptor/adaptor.go index 51b9c7a..dc1b47a 100644 --- a/fasthttpadaptor/adaptor.go +++ b/fasthttpadaptor/adaptor.go @@ -48,7 +48,7 @@ func NewFastHTTPHandler(h http.Handler) fasthttp.RequestHandler { return func(ctx *fasthttp.RequestCtx) { var r http.Request if err := ConvertRequest(ctx, &r, true); err != nil { - ctx.Logger().Printf("cannot parse requestURI %q: %s", r.RequestURI, err) + ctx.Logger().Printf("cannot parse requestURI %q: %v", r.RequestURI, err) ctx.Error("Internal Server Error", fasthttp.StatusInternalServerError) return } diff --git a/fasthttpadaptor/adaptor_test.go b/fasthttpadaptor/adaptor_test.go index aa50fb6..e6d7018 100644 --- a/fasthttpadaptor/adaptor_test.go +++ b/fasthttpadaptor/adaptor_test.go @@ -31,7 +31,7 @@ func TestNewFastHTTPHandler(t *testing.T) { } expectedURL, err := url.ParseRequestURI(expectedRequestURI) if err != nil { - t.Fatalf("unexpected error: %s", err) + t.Fatalf("unexpected error: %v", err) } expectedContextKey := "contextKey" expectedContextValue := "contextValue" @@ -69,7 +69,7 @@ func TestNewFastHTTPHandler(t *testing.T) { body, err := ioutil.ReadAll(r.Body) r.Body.Close() if err != nil { - t.Fatalf("unexpected error when reading request body: %s", err) + t.Fatalf("unexpected error when reading request body: %v", err) } if string(body) != expectedBody { t.Fatalf("unexpected body %q. Expecting %q", body, expectedBody) @@ -109,7 +109,7 @@ func TestNewFastHTTPHandler(t *testing.T) { remoteAddr, err := net.ResolveTCPAddr("tcp", expectedRemoteAddr) if err != nil { - t.Fatalf("unexpected error: %s", err) + t.Fatalf("unexpected error: %v", err) } ctx.Init(&req, remoteAddr, nil) @@ -157,7 +157,7 @@ func TestContentType(t *testing.T) { remoteAddr, err := net.ResolveTCPAddr("tcp", "1.2.3.4:80") if err != nil { - t.Fatalf("unexpected error: %s", err) + t.Fatalf("unexpected error: %v", err) } ctx.Init(&req, remoteAddr, nil) |