摘要: 判断文件或者目录是否存在,如果目录不存在,则创建 package main import ( "fmt" "os" ) func main() { path := "d:/test.txt" b, err := PathExists(path) if err != nil { fmt.Printf( 阅读全文
posted @ 2020-01-05 01:43 lvelvis 阅读(10134) 评论(0) 推荐(0) 编辑
摘要: 1.//创建一个新文件,写入内容 5句 "你好,Golang!" 2.打开一个存在的文件,在原来的内容追加内容 'this is test!' 3.打开一个存在胡文件,读出原来的内容,再追加5行 hello world! package main import ( "bufio" "os" "fmt 阅读全文
posted @ 2020-01-05 00:34 lvelvis 阅读(165) 评论(0) 推荐(0) 编辑
#####