codec: fix noop codec

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-01-29 23:18:12 +03:00
parent 87e1480077
commit 2cb6843773

View File

@ -114,16 +114,22 @@ func (c *noopCodec) Unmarshal(d []byte, v interface{}) error {
switch ve := v.(type) { switch ve := v.(type) {
case string: case string:
ve = string(d) ve = string(d)
return nil
case *string: case *string:
*ve = string(d) *ve = string(d)
return nil
case []byte: case []byte:
ve = d ve = d
return nil
case *[]byte: case *[]byte:
*ve = d *ve = d
return nil
case *Frame: case *Frame:
ve.Data = d ve.Data = d
return nil
case *Message: case *Message:
ve.Body = d ve.Body = d
return nil
} }
return json.Unmarshal(d, v) return json.Unmarshal(d, v)