os/exec: Output
and CombinedOutput
methods should initialize the standard input with os.Stdin
#29521
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
What version of Go are you using (
go version
)?go version go1.11.1 darwin/amd64
Does this issue reproduce with the latest release?
no
What operating system and processor architecture are you using (
go env
)?go env
OutputGOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bo0km4n/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/bo0km4n/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/t2/zbxm3s595p7dk9w66mxvnn7c0000gn/T/go-build582580173=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
I attempted to execute a binary containing a write system call using the os / exec package.
The code of c and the code of go are shown below.
What did you expect to see?
What did you see instead?
Current status
Current
os/exec.go Output and CombinedOutput
is like thisIn default, c.Stdin is setting with
/dev/null
, cause error was occurred in call write system call .In the above code, only
c.Stdout
or bothc.Stdout
andc.Stderr
are initialized bybytes.Buffer
.Proposal
I want to add initialize code like this
The text was updated successfully, but these errors were encountered: