From a5aadcaf6cb6b9550cc42907de17fe31a290749d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sun, 9 Apr 2023 23:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=8D=A2=E8=A1=8C=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- execute.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/execute.go b/execute.go index 08a78b2..3f231aa 100644 --- a/execute.go +++ b/execute.go @@ -64,7 +64,7 @@ func Execute(workDir string, command string, param []string) *define.Result { cmdInstance := exec.Command(command, param...) cmdInstance.Dir = result.WorkDir result.Output, result.Error = cmdInstance.CombinedOutput() - result.Output = []byte(strings.Replace(string(result.Output), "\n", "", -1)) + result.Output = []byte(strings.TrimSpace(string(result.Output))) return result }