change yaml package to support yaml tags

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-09-30 20:21:09 +03:00
parent 560c8d9704
commit 31b7e7182e
4 changed files with 26 additions and 20 deletions

View File

@@ -36,3 +36,19 @@ func TestFrameFlatten(t *testing.T) {
t.Fatalf("bytes not equal %s != %s", buf, `test`)
}
}
func TestNativeYamlTags(t *testing.T) {
s := &struct {
One string `yaml:"first"`
}{
One: "",
}
err := NewCodec().Unmarshal([]byte(`first: "val"`), s)
if err != nil {
t.Fatal(err)
}
if s.One != "val" {
t.Fatalf("XXX %#+v\n", s)
}
}