From df2b4556476a65e1b1cab483c6b631aaf13312cf Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 22 Sep 2021 02:14:12 +0300 Subject: [PATCH] fix options Signed-off-by: Vasiliy Tolstov --- json.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/json.go b/json.go index 3d66bae..d56cd09 100644 --- a/json.go +++ b/json.go @@ -57,8 +57,8 @@ func (c *jsonCodec) Marshal(v interface{}, opts ...codec.Option) ([]byte, error) } marshalOptions := DefaultMarshalOptions - if c.opts.Context != nil { - if f, ok := c.opts.Context.Value(marshalOptionsKey{}).(JsonMarshalOptions); ok { + if options.Context != nil { + if f, ok := options.Context.Value(marshalOptionsKey{}).(JsonMarshalOptions); ok { marshalOptions = f } } @@ -95,8 +95,8 @@ func (c *jsonCodec) Unmarshal(b []byte, v interface{}, opts ...codec.Option) err } unmarshalOptions := DefaultUnmarshalOptions - if c.opts.Context != nil { - if f, ok := c.opts.Context.Value(unmarshalOptionsKey{}).(JsonUnmarshalOptions); ok { + if options.Context != nil { + if f, ok := options.Context.Value(unmarshalOptionsKey{}).(JsonUnmarshalOptions); ok { unmarshalOptions = f } }