package mainimport ( "fmt" "log" "os/exec")func main() { out, err := exec.Command("ls").Output() if err != nil { log.Fatal(err) } fmt.Printf("The ls result is:\n%s", out)}/* Expected Output:The ls result is:output.exeoutput.go*/
相关文章
- 07-31【golang学习笔记】切片
- 07-31Golang之new和make
- 07-31golang_并发安全: slice和map并发不安全及解决方法
- 07-31Golang 切片
- 07-31Golang内置类型和函数
- 07-31Golang数据类型之切片
- 07-31golang快速入门(八)数据类型特别之处(下)
- 07-31golang学习五·五:指针&切片&字典&结构体
- 07-31golang nil切片与空切片的区别
- 07-31golang的make