• 2024-11-20Go - 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