Skip to content

min0625/gsyncmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic Sync Map

Go Reference

This Map is based on generic and sync.Map.

Installation

go get github.com/min0625/gsyncmap

Quick start

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
}

Example

See: ./map_example_test.go