codec: simplify codec interface

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-09-16 22:41:36 +03:00
parent a305f7553f
commit eb1482d789
3 changed files with 8 additions and 105 deletions

View File

@@ -1,7 +1,6 @@
package server
import (
"bytes"
"context"
"fmt"
"reflect"
@@ -691,7 +690,7 @@ func (n *noopServer) createSubHandler(sb *subscriber, opts Options) broker.Handl
req = req.Elem()
}
if err = cf.ReadBody(bytes.NewBuffer(msg.Body), req.Interface()); err != nil {
if err = cf.Unmarshal(msg.Body, req.Interface()); err != nil {
return err
}