How to call other programs and get program output in Go language
This article mainly introduces the Go language how to call other programs and get the program output, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
The specific implementation methods are as follows:
Package mainimport ("exec" / / "os/exec" in go1 "fmt") func main () {cmd: = exec.Command ("ls", "- l") buf,err: = cmd.Output () fmt.Printf ("% s\ n% s", buf,err)} Thank you for reading this article carefully I hope the article "how to call other programs and get program output in Go language" shared by the editor will be helpful to you. At the same time, I hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!