mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:11:36 +08:00
8.2
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
#8.3 for循环构造方法
|
||||
# 8.3 for-range 的配套用法
|
||||
|
||||
190
|
||||
|
||||
可以使用for循环构造map:
|
||||
|
||||
for key, value := range map1 {
|
||||
@@ -21,7 +24,7 @@
|
||||
|
||||
package main
|
||||
import "fmt"
|
||||
|
||||
|
||||
func main() {
|
||||
map1 := make(map[int]float32)
|
||||
map1[1] = 1.0
|
||||
|
Reference in New Issue
Block a user