Golang bekommen Arbeitsverzeichnis
path, err := os.Getwd()
if err != nil {
log.Println(err)
}
fmt.Println(path) // for example /home/user
Repulsive Rattlesnake
path, err := os.Getwd()
if err != nil {
log.Println(err)
}
fmt.Println(path) // for example /home/user
path, err := os.Executable()
if err != nil {
log.Println(err)
}
fmt.Println(path) // for example /tmp/go-build872132473/b001/exe/main