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) {
case string:
ve = string(d)
return nil
case *string:
*ve = string(d)
return nil
case []byte:
ve = d
return nil
case *[]byte:
*ve = d
return nil
case *Frame:
ve.Data = d
return nil
case *Message:
ve.Body = d
return nil
}
return json.Unmarshal(d, v)