1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-12 16:52:29 +08:00

doc: update doc for ExecCommand

This commit is contained in:
dudaodong
2022-12-09 19:20:15 +08:00
parent 09d98745b0
commit 037d2729ce
3 changed files with 41 additions and 13 deletions

View File

@@ -55,9 +55,9 @@ func CompareOsEnv(key, comparedEnv string) bool {
}
// ExecCommand execute command, return the stdout and stderr string of command, and error if error occur
// param `command` is a complete command strinig, like, ls -a (linux), dir(windows), ping 127.0.0.1
// for linux, use /bin/bash -c to execute command
// for windows, use powershell.exe to execute command
// param `command` is a complete command string, like, ls -a (linux), dir(windows), ping 127.0.0.1
// in linux, use /bin/bash -c to execute command
// in windows, use powershell.exe to execute command
func ExecCommand(command string) (stdout, stderr string, err error) {
var out bytes.Buffer
var errOut bytes.Buffer