codec: add []byte support to noop codec

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-10-26 08:26:10 +03:00
parent 416bb313fc
commit d659db69ff
2 changed files with 19 additions and 1 deletions

View File

@@ -106,6 +106,10 @@ func (c *noopCodec) Unmarshal(d []byte, v interface{}, opts ...Option) error {
case *string:
*ve = string(d)
return nil
case []byte:
ve = make([]byte, len(d))
copy(ve, d)
return nil
case *[]byte:
*ve = d
return nil