[Go] go run 时 os.Getwd 和 os.Executable 获取程序根路径
2023-02-18 15:37:37 时间
os.Getwd返回的是当前路径
os.Executable返回的是临时文件的绝对路径
package tools import ( "log" "os" "testing" ) func TestOs(t *testing.T) { log.Println(os.Getwd()) log.Println(os.Executable()) }
相关文章
- Linux系列(14) - grep
- Linux系列(13) - CentOs 8 配置静态IP
- Linux系列(12) - find
- Linux系列(11) - PATH环境变量
- Linux系列(10) - 命令搜索命令whereis与which
- Linux系列(9) - whoami和whatis
- Linux系类(8) - 文件搜索命令locate
- Linux系列(7) - 链接命令
- Linux系列(6) - 常见目录
- Linux系列(5) - 目录处理命令(2)
- Linux系列(4) - 目录处理命令(1)
- Linux系列(3) - ls
- Linux系列(2) - 命令提示符
- Linux系列(1) - 使用Hyper-V安装Linux系统
- Chrome插件 - Modify Headers for Google Chrome(IP欺骗)
- 【深度学习】c++部署onnx模型(Yolov5、PP-HumanSeg、GoogLeNet)
- 【论文笔记】GoogLeNet系列
- Git(2) - git安装、本地仓库与远程仓库使用详细指南
- Git(1) - Git、Github和Gitlab简介
- Power BI模拟麦肯锡多种正方形图表