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

doc: add docment and playground demo for v2.1.19

This commit is contained in:
dudaodong
2023-04-18 15:21:03 +08:00
parent 52ea64bc33
commit fcb3b97b45
10 changed files with 49 additions and 16 deletions

View File

@@ -239,14 +239,17 @@ func main() {
}
```
### <span id="ExecCommand">CompareOsEnv</span>
### <span id="ExecCommand">ExecCommand</span>
<p>Execute shell command, return the stdout and stderr string of command, and error if error occur. 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.</p>
<b>Signature:</b>
```go
func ExecCommand(command string) (stdout, stderr string, err error)
type (
Option func(*exec.Cmd)
)
func ExecCommand(command string, opts ...Option) (stdout, stderr string, err error)
```
<b>Example:</b>

View File

@@ -246,7 +246,10 @@ func main() {
<b>Signature:</b>
```go
func ExecCommand(command string) (stdout, stderr string, err error)
type (
Option func(*exec.Cmd)
)
func ExecCommand(command string, opts ...Option) (stdout, stderr string, err error)
```
<b>Example:</b>