65 lines
1.0 KiB
Go
65 lines
1.0 KiB
Go
|
|
package CmpExec1
|
|
|
|
import (
|
|
"log"
|
|
)
|
|
|
|
func Exec1Print(ret *CmpExec1Struct) {
|
|
log.Println("Path:" , ret.Path )
|
|
log.Println("Args:" , ret.Args )
|
|
log.Println("Error:" , ret.Error )
|
|
log.Println("ExitCode:" , ret.ExitCode )
|
|
log.Println("StdOut:" , ret.StdOut )
|
|
log.Println("StdErr:" , ret.StdErr )
|
|
}
|
|
|
|
|
|
func Exec1SimpleTestErrParm() {
|
|
ret := Exec1Simple(
|
|
"sleep",
|
|
"v",
|
|
)
|
|
Exec1Print(ret)
|
|
}
|
|
|
|
func Exec1SimpleTestErrExec() {
|
|
ret := Exec1Simple(
|
|
"data",
|
|
)
|
|
Exec1Print(ret)
|
|
}
|
|
|
|
func Exec1SimpleTestShotSuccess() {
|
|
ret := Exec1Simple(
|
|
"date",
|
|
)
|
|
Exec1Print(ret)
|
|
}
|
|
|
|
func Exec1SimpleTestLongSuccess() {
|
|
ret := Exec1Simple(
|
|
"sleep",
|
|
"15",
|
|
)
|
|
Exec1Print(ret)
|
|
}
|
|
|
|
func Exec1SimpleTestAll() {
|
|
log.Println("====", "Exec1SimpleTestErrParm")
|
|
|
|
Exec1SimpleTestErrParm()
|
|
|
|
log.Println("====", "Exec1SimpleTestErrExec")
|
|
|
|
Exec1SimpleTestErrExec()
|
|
|
|
log.Println("====", "Exec1SimpleTestShotSuccess")
|
|
|
|
Exec1SimpleTestShotSuccess()
|
|
|
|
log.Println("====", "Exec1SimpleTestLongSuccess")
|
|
|
|
Exec1SimpleTestLongSuccess()
|
|
}
|