diff --git a/json_tool/json_test.go b/json_tool/json_test.go index 24c1a74..d7205aa 100644 --- a/json_tool/json_test.go +++ b/json_tool/json_test.go @@ -64,8 +64,8 @@ func TestSelect(t *testing.T) { "height": 180, "slice": []int{1, 2, 3}, }, - "slice": []int{1, 2, 3}, - "map": map[string]interface{}{"a": 1, "b": 2, "c": 4}, + "slice_data": []int{1, 2, 3}, + "map": map[string]interface{}{"a": 1, "b": 2, "c": 4}, "table": []map[string]interface{}{ {"name": "alex", "age": 18, "number": 1}, {"name": "bob", "age": 28, "number": 2}, @@ -73,11 +73,7 @@ func TestSelect(t *testing.T) { }, } rule := map[string]MapDataRule{ - "name": { - MapKey: "user_name", - DefaultValue: "用户姓名默认值", - IsComplexType: false, - }, + "name": {MapKey: "user_name", DefaultValue: "用户姓名默认值", IsComplexType: false}, "extra.age": {MapKey: "user_age", DefaultValue: "用户年龄默认值", IsComplexType: false}, "extra.height": {MapKey: "user_height", DefaultValue: "扩展高度默认值", IsComplexType: false}, "table.[].name": {MapKey: "slice.[].name_modify", DefaultValue: "列表姓名默认值", IsComplexType: false},