2022年11月15日

Go之ioutil标准库

摘要: 1.读取文件全部内容 path:="./src/test.txt" basepath,_:=filepath.Abs(path) file,_:=os.Open(basepath) defer file.Close() text,_:=ioutil.ReadAll(file) fmt.Println 阅读全文

posted @ 2022-11-15 16:31 孤灯引路人 阅读(39) 评论(0) 推荐(0) 编辑

Go之filepath标准库

摘要: 1. ToSlash 函数:func ToSlash(path string) string 释义: 将 path 中平台相关的路径分隔符转换为 '/' s := "F:\\golang_workspace\\leetcode\\aa.js" fmt.Println("path: ", s) s = 阅读全文

posted @ 2022-11-15 16:09 孤灯引路人 阅读(79) 评论(0) 推荐(0) 编辑

导航