去除换行符

This commit is contained in:
白茶清欢 2023-04-09 23:13:04 +08:00
parent 4a2307ef45
commit a5aadcaf6c

View File

@ -64,7 +64,7 @@ func Execute(workDir string, command string, param []string) *define.Result {
cmdInstance := exec.Command(command, param...) cmdInstance := exec.Command(command, param...)
cmdInstance.Dir = result.WorkDir cmdInstance.Dir = result.WorkDir
result.Output, result.Error = cmdInstance.CombinedOutput() 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 return result
} }