an00/an00.github.io

golang 文件操作

Opened this issue · 0 comments

an00 commented

https://blog.an00.cn/2019/12/08/golang-%E6%96%87%E4%BB%B6%E6%93%8D%E4%BD%9C/

golang 文件操作 打开文件 在 golang 中,用 os.Open() 来打开文件,将返回一个文件实例 *File 和错误 err,文件实例调用 Close() 方法来关闭文件 1234567891011121314151617package mainimport ( "fmt" "os")func main() { // 打开文件 file, err :