From 6b4608671f78fa48dc447a97bb730e5548443b0d Mon Sep 17 00:00:00 2001 From: fmhr Date: Fri, 19 Apr 2024 22:26:32 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E6=99=82=E3=82=82st?= =?UTF-8?q?dout,=20stderr=E3=82=92=E8=BF=94=E3=81=99=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unix_specific.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unix_specific.go b/unix_specific.go index a83e132..455d554 100644 --- a/unix_specific.go +++ b/unix_specific.go @@ -37,8 +37,11 @@ func runCommandWithTimeout(cmdStrings []string, cnf *Config) ([]byte, string, er } case err := <-errCh: if err != nil { + rtn := make([]byte, 0, len(stdoutBuf.Bytes())+len(stderrBuf.Bytes())) + rtn = append(rtn, stdoutBuf.Bytes()...) + rtn = append(rtn, stderrBuf.Bytes()...) log.Println("Error: ", err, "command:", cmd.String()) - return nil, result, fmt.Errorf("cmd.Wait() failed with: %v", err) + return rtn, result, fmt.Errorf("cmd.Wait() failed with: %v", err) } }