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) } }