20 lines
290 B
Go
20 lines
290 B
Go
|
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)
|
||
|
}
|
||
|
}
|