35 - 读取文件

pull/11/head
Tinywan 6 years ago
parent 30b377189b
commit c33fab4524

@ -73,8 +73,11 @@ $ go get github.com/Tinywan/golang-tutorial
###### 30 - 错误处理
###### 31 - 自定义错误
###### 32 -Panic 和 Recover
###### 33 - 头等函数
######34 - 反射
#### 头等函数
###### 33 - 头等函数
#### 反射
###### 34 - 反射
#### 文件操作
###### [35 - 读文件](/docs/golang_tutorial_35.md)
#### 文档

@ -2,12 +2,20 @@ package main
import (
"fmt"
"os"
"strings"
)
var age int
func main() {
name := "Tinywan"
fmt.Println(name)
fmt.Println(name)
}
os.Setenv("Name", "Tinywan")
fmt.Println("Name = ", os.Getenv("Name"))
fmt.Println("Bar", os.Getenv("bar"))
fmt.Println()
fmt.Println()
for _, e := range os.Environ() {
pair := strings.Split(e, "=")
fmt.Println(pair[0])
}
}
go

@ -1,7 +1,9 @@
35 - 读取文件
========================
<div align="center">
<img src="../images/golang-read-files.png"/><br><br>
</div>
上一节:[第十六篇 结构体](/docs/golang_tutorial_16.md)
下一节:[第十八篇 接口一](/docs/golang_tutorial_18.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Loading…
Cancel
Save