changed embedded mutex to private field (#217)
Some checks failed
sync / sync (push) Failing after 16m12s
test / test (push) Failing after 17m28s
coverage / build (push) Failing after 17m40s

This commit is contained in:
2025-05-25 03:15:03 +05:00
committed by GitHub
parent 0f8f12aee0
commit 13f90ff716
13 changed files with 151 additions and 151 deletions

View File

@@ -14,16 +14,16 @@ type NoopBroker struct {
funcPublish FuncPublish
funcSubscribe FuncSubscribe
opts Options
sync.RWMutex
mu sync.RWMutex
}
func (b *NoopBroker) newCodec(ct string) (codec.Codec, error) {
if idx := strings.IndexRune(ct, ';'); idx >= 0 {
ct = ct[:idx]
}
b.RLock()
b.mu.RLock()
c, ok := b.opts.Codecs[ct]
b.RUnlock()
b.mu.RUnlock()
if ok {
return c, nil
}