Merge pull request #534 from xushiwei/q

demo: osexec - todo
This commit is contained in:
xushiwei
2024-07-18 23:01:27 +08:00
committed by GitHub

18
_demo/osexec/exec.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"os"
"os/exec"
"runtime"
)
func main() {
ls := "ls"
if runtime.GOOS == "windows" {
ls = "dir"
}
cmd := exec.Command(ls)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()
}