-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: StartProcess doesn't pass the arguments #23277
Comments
Thank you for raising this issue. Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process. Please see https://golang.org/wiki/Questions for good places to ask questions. |
It looks like at first, but the big code pasting is not my program, but a proof of the bug. |
For https://golang.org/pkg/os/#StartProcess, your argv must contain the binary name first, before the "actual" arguments. But really nobody should use os.StartProcess. You should use the |
Oh, thanks ! But, shouldn't this be written in the os.StartProcess doc ? |
Well, it does say:
And I guess people familiar with the low-level interface know the meaning of But sure, I'll send a change with a bit of docs. |
Guess it's my bad, i only looked at the in-code doc, and i'm new to low-level programming, thanks tho ! |
Change https://golang.org/cl/85675 mentions this issue: |
No worries. I sent https://go-review.googlesource.com/#/c/go/+/85675 |
As Brad mentioned, you probably don’t want to use this low level interface.
Try
https://golang.org/pkg/os/exec/#Cmd
… On 29 Dec 2017, at 12:15, Adrien Navratil ***@***.***> wrote:
Guess it's my bad, i only looked at the in-code doc, and i'm new to low-level programming, thanks tho !
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I managed to do it using this, thanks ! |
Fixes #23277 Change-Id: Idbe09913c95dc951b9b195eb7ff1e75d2bb4d63d Reviewed-on: https://go-review.googlesource.com/85675 Reviewed-by: Ian Lance Taylor <iant@golang.org>
I tried everything, but os.StartProcess seems to not pass the given arguments
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
test_executable :
main.go :
What did you expect to see?
Output should be :
Starting : test_executable a_random_arg
stdout.log should contain :
Args are : a_random_arg
, as it shows when i'm copy pasting the commandtest_executable a_random_arg
in my terminalWhat did you see instead?
Output is :
Starting : test_executable a_random_arg
stdout.log contains :
Args are :
, there is no args givenThe text was updated successfully, but these errors were encountered: