Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Generic implementation of sync.Map
https://github.com/survivorbat/go-tsyncmap

generic go golang gopkg library map package sync syncmap type types

Last synced: about 2 months ago
JSON representation

Generic implementation of sync.Map

Awesome Lists containing this project

README

        

# πŸ—ΊοΈοΈ Generic sync.Map

[![Go package](https://github.com/survivorbat/go-tsyncmap/actions/workflows/test.yaml/badge.svg)](https://github.com/survivorbat/go-tsyncmap/actions/workflows/test.yaml)
![GitHub](https://img.shields.io/github/license/survivorbat/go-tsyncmap)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/survivorbat/go-tsyncmap)

A wrap around sync.Map that uses generics.

```go
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

```go
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.