diff --git a/wrphttp/decoders.go b/wrphttp/decoders.go index 1c9fdb9..e4081f6 100644 --- a/wrphttp/decoders.go +++ b/wrphttp/decoders.go @@ -96,7 +96,7 @@ func DecodeRequestHeaders(ctx context.Context, original *http.Request) (*Entity, // DecodeRequest is a Decoder that provides lower-level way of decoding an *http.Request // Can work for servers that don't use a wrp.Handler -func DecodeRequest(r *http.Request, msg any) (*http.Request, error) { +func DecodeRequest(r *http.Request, _ any) (*http.Request, error) { if _, ok := wrpcontext.GetMessage(r.Context()); ok { // Context already contains a message, so just return the original request diff --git a/wrphttp/decoders_test.go b/wrphttp/decoders_test.go index 6020a65..04c596a 100644 --- a/wrphttp/decoders_test.go +++ b/wrphttp/decoders_test.go @@ -234,7 +234,7 @@ func testDecodeRequestSuccess(t *testing.T) { ) require.NoError( - wrp.NewEncoderBytes(&body, record.bodyFormat).Encode(&expected), + wrp.NewEncoderBytes(&body, record.bodyFormat).Encode(expected), ) request := httptest.NewRequest("POST", "/", bytes.NewBuffer(body)) @@ -246,15 +246,14 @@ func testDecodeRequestSuccess(t *testing.T) { expected.Type = record.msgType } - var msg wrp.Message - actual, err := DecodeRequest(request, &msg) - msg, ok := wrpcontext.Get[wrp.Message](actual.Context()) + actual, err := DecodeRequest(request, nil) + msg, ok := wrpcontext.GetMessage(actual.Context()) assert.True(ok) assert.Nil(err) require.NotNil(actual) require.NotNil(actual.Context()) - assert.Equal(expected, &msg) + assert.Equal(expected, msg) } }