增加返回命令参数
This commit is contained in:
parent
2f8be1dea3
commit
cd60d4c81d
@ -15,6 +15,7 @@ package define
|
||||
type Result struct {
|
||||
WorkDir string // 执行的目录
|
||||
CmdPath string // 命令的路径
|
||||
Param []string // 执行命令的参数
|
||||
Error error // 异常信息
|
||||
Output []byte // 输出的内容
|
||||
StartTime int64 // 开始时间
|
||||
|
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user