mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-11-13 17:27:39 +08:00
@@ -14,13 +14,11 @@ for key, value := range map1 {
|
||||
|
||||
(2)如何在一个映射中检测键 `key1` 是否存在:
|
||||
|
||||
`val1, isPresent = map1[key1]`
|
||||
`val1, isPresent = map1[key1]`
|
||||
|
||||
返回值:键 `key1` 对应的值或者 `0`,`true` 或者 `false`
|
||||
|
||||
(3)如何在映射中删除一个键:
|
||||
返回值:键 `key1` 对应的值或者 `0`,`true` 或者 `false`
|
||||
|
||||
`delete(map1, key1)`
|
||||
(3)如何在映射中删除一个键:`delete(map1, key1)`
|
||||
|
||||
## 链接
|
||||
|
||||
|
||||
Reference in New Issue
Block a user