网站首页
编程语言
数据库
系统相关
其他分享
编程问答
ZTest
2024-11-20
Go - Get current directory of a source file
packagemainimport("fmt""os")funcmain(){fmt.Println(os.Executable())fmt.Println(os.Getwd())} zzh@ZZHPC:~/zd/Github/ztest$gorunmain.go/tmp/go-build2963213184/b001/exe/main<nil>/home/zzh/zd