This Map is based on generic
and sync.Map
.
go get github.com/min0625/gsyncmap
package main
import "github.com/min0625/gsyncmap"
func main() {
var m gsyncmap.Map[string, string]
m.Store("k1", "v1")
fmt.Println(m.Load("k1")) // v1 true
fmt.Println(m.Load("k2")) // false
m.Delete("k1")
fmt.Println(m.Load("k1")) // false
}