Skip to content
/ syncmap Public
forked from DeanThompson/syncmap

A thread safe map implementation for Golang

License

Notifications You must be signed in to change notification settings

anoty/syncmap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

syncmap

GoDoc Build Status

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%