From cd60d4c81d5a2fa61262a1883cdcfe604a99c2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sat, 21 May 2022 19:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- define/result.go | 13 +++++++------ execute.go | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/define/result.go b/define/result.go index 44a6b68..de273a8 100644 --- a/define/result.go +++ b/define/result.go @@ -13,10 +13,11 @@ package define // // Date : 22:00 2022/5/20 type Result struct { - WorkDir string // 执行的目录 - CmdPath string // 命令的路径 - Error error // 异常信息 - Output []byte // 输出的内容 - StartTime int64 // 开始时间 - FinishTime int64 // 完成时间 + WorkDir string // 执行的目录 + CmdPath string // 命令的路径 + Param []string // 执行命令的参数 + Error error // 异常信息 + Output []byte // 输出的内容 + StartTime int64 // 开始时间 + FinishTime int64 // 完成时间 } diff --git a/execute.go b/execute.go index 13abecf..1647390 100644 --- a/execute.go +++ b/execute.go @@ -21,11 +21,12 @@ import ( // Author : go_developer@163.com<白茶清欢> // // Date : 21:49 2022/5/20 -func Execute(workDir string, command string, param []string) define.Result { +func Execute(workDir string, command string, param []string) *define.Result { //执行命令 - result := define.Result{ + result := &define.Result{ WorkDir: workDir, + Param: param, Error: nil, Output: nil, StartTime: time.Now().UnixNano(),