diff --git a/README.md b/README.md index 6402161..8633be3 100644 --- a/README.md +++ b/README.md @@ -73,13 +73,8 @@ $ go get github.com/Tinywan/golang-tutorial ### 34 - 反射 ### 35 - 读文件 -## 官方文档 +## 其他文档 * [如何编写Go代码](/docs/how_to_write_go_code.md) - -###### HELP * [原文](https://golangbot.com/) -* [译者一](http://blog.csdn.net/u011304970/article/details/74797939) -* [译者二](https://www.studygolang.com/gctt/Noluye) -本文由 [GCTT](https://github.com/studygolang/GCTT) 原创翻译,[Go语言中文网](https://studygolang.com/)首发。 \ No newline at end of file diff --git a/demo/point/map01.go b/demo/point/map01.go index 1650646..811d9a7 100644 --- a/demo/point/map01.go +++ b/demo/point/map01.go @@ -1,15 +1,24 @@ package main import ( + "time" "fmt" ) -func main(){ +func main() { // map[KeyType]ValueType 集合类型 - var personSalary map[string]int + var personSalary map[string]int // go的三个引用类型 map slice chan if personSalary == nil { fmt.Println("map is nil. Going to make one.") personSalary = make(map[string]int) + fmt.Printf(format string, a ...interface{}) + time.Microsecond + fmt.Printf(format string, a ...interface{}) + fmt.Print(a ...interface{}) + time.Millisecond(); + fmt.Print(a) + fmt.Println(a) + fmt.Printf(format, a) } -} \ No newline at end of file +} diff --git a/demo/point/map02.go b/demo/point/map02.go index d40be64..718707b 100644 --- a/demo/point/map02.go +++ b/demo/point/map02.go @@ -33,6 +33,7 @@ func main(){ }else{ fmt.Println(newEmp,"not found") } + fmt.Println("----------------遍历 map 中所有的元素---------------------") for key,value := range personSalary { fmt.Printf("personSalary[%s] = %d \n",key,value)