There is a failure in exec.Command because it returns an error when a command is not found in the path so you can not run aliases defined in your Unix system neither run typical command in windows systems like "copy".
package main
import (
"log"
"os/exec"
)
func main() {
err := exec.Command("ll").Run()
if err != nil {
log.Fatal(err)
}
}
exec: "ll": executable file not found in $PATH
exit status 1
* * *
$ alias | grep "ll="
alias ll='ls -alF'
In Windows system, you can not run the basic commands:
package main
import (
"log"
"os/exec"
)
func main() {
err := exec.Command("copy", "/?").Run()
if err != nil {
log.Fatal(err)
}
}
exec: "copy": executable file not found in %PATH%