internal:forkAndExecInChild chdir

This commit is contained in:
luoliwoshang
2025-06-05 18:54:25 +08:00
parent 87c7b65223
commit 701568e011
3 changed files with 6 additions and 10 deletions

View File

@@ -3,11 +3,13 @@ package main
import (
"bytes"
"os/exec"
"path/filepath"
)
func main() {
var data bytes.Buffer
cmd := exec.Command("echo", "hello llgo")
cmd.Dir = filepath.Dir("./")
cmd.Stdout = &data
err := cmd.Run()
if err != nil {