update go.mod
Some checks failed
build / test (push) Failing after 25s
build / lint (push) Failing after 14m14s
codeql / analyze (go) (push) Failing after 14m13s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-12 01:54:35 +03:00
parent 6ee83fb2cf
commit f8cffe1081
4 changed files with 26 additions and 48 deletions

View File

@@ -1,46 +0,0 @@
package codec_test
import (
"testing"
grpc "go.unistack.org/micro-codec-grpc/v3"
json "go.unistack.org/micro-codec-json/v3"
proto "go.unistack.org/micro-codec-proto/v3"
"go.unistack.org/micro/v3/codec"
)
type testRWC struct{}
func (rwc *testRWC) Read(p []byte) (n int, err error) {
return 0, nil
}
func (rwc *testRWC) Write(p []byte) (n int, err error) {
return 0, nil
}
func (rwc *testRWC) Close() error {
return nil
}
func getCodecs() map[string]codec.Codec {
return map[string]codec.Codec{
"bytes": codec.NewCodec(),
"grpc": grpc.NewCodec(),
"json": json.NewCodec(),
"proto": proto.NewCodec(),
}
}
func Test_WriteEmptyBody(t *testing.T) {
rw := &testRWC{}
for name, c := range getCodecs() {
err := c.Write(rw, &codec.Message{
Type: codec.Error,
Header: map[string]string{},
}, nil)
if err != nil {
t.Fatalf("codec %s - expected no error when writing empty/nil body: %s", name, err)
}
}
}