aboutsummaryrefslogtreecommitdiff
path: root/fasthttpadaptor
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 /fasthttpadaptor
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 'fasthttpadaptor')
-rw-r--r--fasthttpadaptor/adaptor.go2
-rw-r--r--fasthttpadaptor/adaptor_test.go8
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)