survivorbat / go-tsyncmap

Generic implementation of sync.Map

Home Page:https://pkg.go.dev/github.com/survivorbat/go-tsyncmap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🗺️️ Generic sync.Map

Go package GitHub GitHub go.mod Go version

A wrap around sync.Map that uses generics.

package main

import "github.com/survivorbat/go-tsyncmap"

func main() {
	myMap := tsyncmap.Map[string, string]{}
	
	myMap.Store("a", "b")
	
	myMap.Load("a") // Returns "b"
}

⬇️ Installation

go get github.com/survivorbat/go-tsyncmap

📋 Usage

package main

import "github.com/survivorbat/go-tsyncmap"

func main() {
	myMap := tsyncmap.Map[string, string]{}

	myMap.Store("a", "b")

	myMap.Load("a") // Returns "b"
}

🔭 Plans

Not much.

About

Generic implementation of sync.Map

https://pkg.go.dev/github.com/survivorbat/go-tsyncmap

License:MIT License


Languages

Language:Go 92.6%Language:Makefile 7.4%