a better customizable tool to embed files in go; also update embedded files remotely without restarting the server
634
stars
53
forks
source link
Fix execution on some environments: os.Args[0] is not the current directory #7
Closed
andreynering closed 7 years ago
Go can understand relative paths. No need to convert to absolute.
EDIT: just to explain.
A command like this:
Woks on
cmd
on Windows, but not on Git bash, because the command will to converted to:So it returns an error like this:
This is because
os.Args[0]
constains the executable path, not the working directory.An alternative would be using
os.Getwd()
, but Go does that automatically.