intial state
This commit is contained in:
19
exp/exec/exec.go
Normal file
19
exp/exec/exec.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("vim-go")
|
||||
c := exec.Command("./script.sh")
|
||||
op, err := c.Output()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
exitErr := err.(*exec.ExitError)
|
||||
fmt.Printf("hello %s\n", exitErr.Stderr)
|
||||
} else {
|
||||
fmt.Printf("%s", op)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user