浅谈Go语言中的文件读入

/本篇blog是因为1-10.go而写的/

听说我居然在文件写入的时候遇到了麻烦?

对了,1-10.go的位置:
https://github.com/ShiinaOrez/go_practice/blob/master/Go%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1%E8%AF%AD%E8%A8%80/1/1-10.go


Go-文件写入的四种方式


第一种:io.WriteString()

在此之前介绍两个函数:

    func checkFileIsExist(filename string) bool
    func check(err error) bool

checkFileIsExist()

func checkFileIsExist(filename string) bool {
    exist:=true
    if _,err:=os.Stat(filename);os.IsNotExist(err){
        exi

你可能感兴趣的:(go,go语言)