We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ead21b1 + 722bd04 commit fed55a2Copy full SHA for fed55a2
ebook/02.2.md
@@ -400,6 +400,7 @@ slice有一些简便的操作
400
- `map`的长度是不固定的,也就是和`slice`一样,也是一种引用类型
401
- 内置的`len`函数同样适用于`map`,返回`map`拥有的`key`的数量
402
- `map`的值可以很方便的修改,通过`numbers["one"]=11`可以很容易的把key为`one`的字典值改为`11`
403
+- `map`和其他基本型别不同,它不是thread-safe,在多个go-routine存取时,必须使用mutex lock机制
404
405
`map`的初始化可以通过`key:val`的方式初始化值,同时`map`内置有判断是否存在`key`的方式
406
0 commit comments