Go 常用工具函数 Eli He 2018-01-22 Golang 1. 获取程序所在的运行目录1234567func GetAppPath() string { file, _ := exec.LookPath(os.Args[0]) path, _ := filepath.Abs(file) index := strings.LastIndex(path, string(os.PathSeparator)) return path[:index]} 更新于 2021年6月22日 上一页 Go xorm orm 下一页 Go 包安装问题 go