Skip to content

jacquayj/safemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

safemap

Thread-safe maps using go generics

  1. Compile and install go master from source https://golang.org/doc/install/source
  2. /my/go/install/go run -gcflags=-G=3 test.go

test.go:

package main

import (
    "fmt"

    "github.com/jacquayj/safemap"
)

func main() {

    test := safemap.NewMap(map[string]int{
        "test":    1234,
        "another": 456,
    })

    num, ok := test.Get("test")
    fmt.Print(num, ok)

    test.Set("another-key", 789)

    num2, ok := test.Get("another-key")
    fmt.Print(num2, ok)


    ok = test.Delete("test")
    fmt.Print(ok)

}

About

Thread-safe maps using go generics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages