Skip to content

Commit

Permalink
Merge pull request #534 from xushiwei/q
Browse files Browse the repository at this point in the history
demo: osexec - todo
  • Loading branch information
xushiwei authored Jul 18, 2024
2 parents 7232fc3 + 2b3dafe commit eeabc6b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions _demo/osexec/exec.go
Original file line number Diff line number Diff line change
@@ -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()
}

0 comments on commit eeabc6b

Please sign in to comment.