This commit is contained in:
Unknwon
2015-02-24 00:41:12 -05:00
parent 80344c8375
commit 64bb8b3ea3
4 changed files with 54 additions and 46 deletions

View File

@@ -1,4 +1,7 @@
#8.6 倒置map
# 8.6 map 的键值对调
194
这里倒置是指调换key和value。如果map的值类型可以作为key且所有的value是唯一的那么通过下面的方法可以简单的做到倒置
示例 8.7 [invert_map.go](examples/chapter_8/invert_map.go)
@@ -26,7 +29,7 @@
}
fmt.Println()
}
输出结果:
inverted: