add thread save map tips in go

This commit is contained in:
2018-12-24 14:29:33 +11:00
parent 3c25246681
commit 20830287e0
+8 -1
View File
@@ -67,6 +67,13 @@ ch := make(chan Task, 3)
\`aaa bbb ccc\`
- panic / recover
- `sync.Map` is concurrent/ thread safe `map`, normal `map` isn't
```go
m := new(sync.Map)
m.Store("a", "b")
value, ok := m.Load("a")
```
# Frameworks
@@ -199,4 +206,4 @@ REPL stands for read eval print loop, basically it just like the irb in Ruby.
Wiki: <https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop>
* gore <https://github.com/motemen/gore>
* gore <https://github.com/motemen/gore>