mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 23:52:31 +08:00
[Bug] Fix wrong contents of 8.4 and add sample code
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# 8.3 map 类型的切片
|
||||
# 8.4 map 类型的切片
|
||||
|
||||
假设我们想获取一个 map 类型的切片,我们必须使用两次 `make()` 函数,第一次分配切片,第二次分配 切片中每个 map 元素(参见下面的例子 8.3)。
|
||||
假设我们想获取一个 map 类型的切片,我们必须使用两次 `make()` 函数,第一次分配切片,第二次分配 切片中每个 map 元素(参见下面的例子 8.4)。
|
||||
|
||||
示例 8.3 [maps_forrange.go](examples/chapter_8/maps_forrange.go):
|
||||
示例 8.4 [maps_forrange2.go](examples/chapter_8/maps_forrange2.go):
|
||||
|
||||
```go
|
||||
package main
|
||||
|
Reference in New Issue
Block a user