1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00
This commit is contained in:
2022-04-29 17:18:27 +08:00
parent 830a870158
commit f6ecb9be4b
4 changed files with 62 additions and 7 deletions

View File

@ -21,9 +21,21 @@ func TestStructToMap(t *testing.T) {
OmitEmpty: 0,
}
t.Log(structs.ToMap(o, structs.TagName("struct")))
t.Log(structs.ToMap(o, structs.IgnoreEmpty()))
t.Log(structs.ToMap(o, structs.Omitempty()))
t.Log(structs.ToMap(o, structs.Lcfirst()))
t.Log(structs.ToMap(o, structs.Camel2Case()))
t.Log(structs.Struct2Map(o, structs.TagName("struct")))
t.Log(structs.Struct2Map(o, structs.IgnoreEmpty()))
t.Log(structs.Struct2Map(o, structs.Omitempty()))
t.Log(structs.Struct2Map(o, structs.Lcfirst()))
t.Log(structs.Struct2Map(o, structs.Camel2Case()))
}
func TestMapToStruct(t *testing.T) {
}
func TestMap2Map(t *testing.T) {
source := map[string]any{
"Abc": 143,
}
structs.New(source)
}