Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.
DeanThompsonPublic archive

About

A thread safe map implementation for Golang

Resources

Stars

115 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

DEPRECATED syncmap

GoDoc Build Status

THIS PACKAGE IS DEPRECATED, PLEASE USE THE sync.Map PROVIDED BY GO STANDARD LIBRARY.

A thread safe map implementation for Golang

Usage

Install with:

go get github.com/DeanThompson/syncmap

Example:

import (
    "fmt"

    "github.com/DeanThompson/syncmap"
)

func main() {
    m := syncmap.New()
    m.Set("one", 1)
    v, ok := m.Get("one")
    fmt.Println(v, ok)  // 1, true

    v, ok = m.Get("not_exist")
    fmt.Println(v, ok)  // nil, false

    m.Set("two", 2)
    m.Set("three", "three")

    for item := range m.IterItems() {
        fmt.Println("key:", item.Key, "value:", item.Value)
    }
}

About

A thread safe map implementation for Golang

Resources

Stars

115 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages