-
Notifications
You must be signed in to change notification settings - Fork 18k
os/exec: document that LookPath result may only be valid relative to current directory #3622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
The fixed program would go something like // find our executable path, err := exec.LookPath(prog) if err != nil { log.Fatal(err) } // get absolute path so we can run it from /tmp path, err = filepath.Abs(path) if err != nil { log.Fatal(err) } // run our executable with /tmp directory as current cmd := exec.Command(path) cmd.Dir = os.TempDir() out, err := cmd.CombinedOutput() if err != nil { log.Fatal(err) } fmt.Printf("out=%v\n", string(out)) |
This issue was closed by revision a41a5bb. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: