package main import ( "fmt" "log" "os/exec" ) func main() { out, err := exec.Command("ls", "/bin").Output() if err != nil { log.Fatal(err) return } fmt.Print(string(out)) }