1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add doc for CurrentMap

This commit is contained in:
dudaodong
2023-07-27 15:08:55 +08:00
parent 4558d7a3c2
commit 0ae5d17a06
3 changed files with 724 additions and 5 deletions

View File

@@ -24,17 +24,13 @@ func TestConcurrentMap_Set_Get(t *testing.T) {
}
wg1.Wait()
var wg2 sync.WaitGroup
wg2.Add(10)
for j := 0; j < 10; j++ {
go func(n int) {
val, ok := cm.Get(fmt.Sprintf("%d", n))
assert.Equal(n, val)
assert.Equal(true, ok)
wg2.Done()
}(j)
}
wg2.Wait()
}
func TestConcurrentMap_GetOrSet(t *testing.T) {