gitee.com/sy_183/go-common@v1.0.5-0.20231205030221-958cfe129b47/container/test/main.go (about)

     1  package main
     2  
     3  import (
     4  	"gitee.com/sy_183/go-common/container"
     5  	"github.com/gofrs/uuid"
     6  )
     7  
     8  func main() {
     9  	l := 200000
    10  	m := container.NewLinkedMap[int, string](l, l)
    11  	for i := 0; i < l; i++ {
    12  		m.Push(i, uuid.Must(uuid.NewV4()).String())
    13  	}
    14  	var next *container.LinkedMapEntry[int, string]
    15  	for first := m.HeadEntry(); first != nil; first = next {
    16  		next = first.Next()
    17  		m.RemoveEntry(first)
    18  	}
    19  }