update to latest micro, optimize flatten

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-09-17 12:42:07 +03:00
parent 0aee8591b6
commit da9a4a3dd9
4 changed files with 37 additions and 86 deletions

View File

@@ -28,7 +28,7 @@ func TestFrameFlatten(t *testing.T) {
Name: &codec.Frame{Data: []byte("test")},
}
buf, err := NewCodec().Marshal(s)
buf, err := NewCodec(codec.Flatten(true)).Marshal(s)
if err != nil {
t.Fatal(err)
}
@@ -44,7 +44,7 @@ func TestStructByTag(t *testing.T) {
val := &Str{Name: []string{"first", "second"}}
c := NewCodec()
c := NewCodec(codec.Flatten(true))
buf, err := c.Marshal(val)
if err != nil {
t.Fatal(err)
@@ -60,15 +60,3 @@ func TestStructByTag(t *testing.T) {
t.Fatalf("invalid unmarshal: %v", nval)
}
}
func TestReadBody(t *testing.T) {
s := &struct {
Name string
}{}
c := NewCodec()
b := bytes.NewReader(nil)
err := c.ReadBody(b, s)
if err != nil {
t.Fatal(err)
}
}