File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -73,13 +73,8 @@ $ go get github.com/Tinywan/golang-tutorial
7373### 34 - 反射
7474### 35 - 读文件
7575
76- ## 官方文档
76+ ## 其他文档
7777
7878* [ 如何编写Go代码] ( /docs/how_to_write_go_code.md )
79-
80- ###### HELP
8179* [ 原文] ( https://golangbot.com/ )
82- * [ 译者一] ( http://blog.csdn.net/u011304970/article/details/74797939 )
83- * [ 译者二] ( https://www.studygolang.com/gctt/Noluye )
8480
85- 本文由 [ GCTT] ( https://github.com/studygolang/GCTT ) 原创翻译,[ Go语言中文网] ( https://studygolang.com/ ) 首发。
Original file line number Diff line number Diff line change 11package main
22
33import (
4+ "time"
45 "fmt"
56)
67
7- func main (){
8+ func main () {
89 // map[KeyType]ValueType 集合类型
9- var personSalary map [string ]int
10+ var personSalary map [string ]int
1011 // go的三个引用类型 map slice chan
1112 if personSalary == nil {
1213 fmt .Println ("map is nil. Going to make one." )
1314 personSalary = make (map [string ]int )
15+ fmt .Printf (format string , a ... interface {})
16+ time .Microsecond
17+ fmt .Printf (format string , a ... interface {})
18+ fmt .Print (a ... interface {})
19+ time .Millisecond ();
20+ fmt .Print (a )
21+ fmt .Println (a )
22+ fmt .Printf (format , a )
1423 }
15- }
24+ }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ func main(){
3333 }else {
3434 fmt .Println (newEmp ,"not found" )
3535 }
36+
3637 fmt .Println ("----------------遍历 map 中所有的元素---------------------" )
3738 for key ,value := range personSalary {
3839 fmt .Printf ("personSalary[%s] = %d \n " ,key ,value )
You can’t perform that action at this time.
0 commit comments