Commit fb9897f3 by huangchengyi

1.0

parent 5348da38
Showing with 27 additions and 0 deletions
package main
import (
cmap "github.com/orcaman/concurrent-map"
)
func main() {
m := cmap.New()
// Sets item within map, sets "bar" under key "foo"
m.Set("foo", "bar")
m.Set("a1", "dd")
m.Set("b2", "ba343r")
// Retrieve item from map.
if tmp, ok := m.Get("foo"); ok {
bar := tmp.(string)
println(bar)
}
s,_ := m.MarshalJSON()
println(string(s))
// Removes item under key "foo"
//m.Remove("foo")
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment