|
@@ -11,7 +11,7 @@ func TestGetValueInMap(t *testing.T) {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
- value, err := GetValueInMap(testMap, "foo1.foo1_sub.[0]")
|
|
|
+ value, err := GetValueByPath(testMap, "foo1.foo1_sub.[0]")
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -20,7 +20,7 @@ func TestGetValueInMap(t *testing.T) {
|
|
|
t.Fatal("值不一致")
|
|
|
}
|
|
|
|
|
|
- value, err = GetValueInMap(testMap, "foo1.foo1_sub.[1]")
|
|
|
+ value, err = GetValueByPath(testMap, "foo1.foo1_sub.[1]")
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -39,12 +39,12 @@ func TestGetValue(t *testing.T) {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
- foo1Map, ok := GetValue[string, map[string]any](testMap, "foo1")
|
|
|
+ foo1Map, ok := GetValueByKey[string, map[string]any](testMap, "foo1")
|
|
|
if !ok {
|
|
|
t.Fatal("取foo1值失败")
|
|
|
}
|
|
|
|
|
|
- foo1Sub, ok := GetValue[string, []any](foo1Map, "foo1_sub")
|
|
|
+ foo1Sub, ok := GetValueByKey[string, []any](foo1Map, "foo1_sub")
|
|
|
if !ok {
|
|
|
t.Fatal("取foo1Sub值失败")
|
|
|
}
|