mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
map
This commit is contained in:
@ -13,10 +13,12 @@ func TestForEach(t *testing.T) {
|
||||
assert.True(t, hashMap.Exist("a"))
|
||||
assert.Equal(t, len(m), hashMap.Count())
|
||||
|
||||
hashMap.ForEach(func(s string, a any) {
|
||||
hashMap.ForEach(func(s string, a any) bool {
|
||||
if _, ok := m[s]; !ok {
|
||||
t.Fatal("值不存在")
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
for k := range m {
|
||||
|
Reference in New Issue
Block a user