diff --git a/encoding.go b/encoding.go index 8178c42e3..2f5fc108a 100644 --- a/encoding.go +++ b/encoding.go @@ -151,8 +151,8 @@ func (r *DefaultCodecRegistry) Decoder(format string) (Decoder, error) { } func (r *DefaultCodecRegistry) codec(format string) (Codec, bool) { - r.mu.Lock() - defer r.mu.Unlock() + r.mu.RLock() + defer r.mu.RUnlock() format = strings.ToLower(format)