[v3] remove using global map for default codecs (#224)
Some checks failed
test / test (push) Failing after 15m22s
coverage / build (push) Failing after 15m33s

* remove using global map for default codecs

* fix tests
This commit is contained in:
2025-10-15 23:33:32 +05:00
committed by GitHub
parent a68d3b24b8
commit 3e86864ce7
5 changed files with 6 additions and 21 deletions

View File

@@ -17,11 +17,6 @@ import (
"go.unistack.org/micro/v3/tracer"
)
// DefaultCodecs will be used to encode/decode data
var DefaultCodecs = map[string]codec.Codec{
"application/octet-stream": codec.NewCodec(),
}
type noopClient struct {
funcPublish FuncPublish
funcBatchPublish FuncBatchPublish
@@ -178,9 +173,6 @@ func (n *noopClient) newCodec(contentType string) (codec.Codec, error) {
if cf, ok := n.opts.Codecs[contentType]; ok {
return cf, nil
}
if cf, ok := DefaultCodecs[contentType]; ok {
return cf, nil
}
return nil, codec.ErrUnknownContentType
}