You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
golang-tutorial/main.go

25 lines
522 B

package main
import (
"fmt"
"os"
"os/exec"
"github.com/Tinywan/golang-tutorial/stringutil"
)
func main() {
//fmt.Println("Hello golang-tutorial!")
fmt.Printf(stringutil.Reverse("!oG ,olleH"))
cmd := exec.Command("pwd")
stdin,err :=cmd.StdinPipe();
if err != nil {
fmt.Println(err)
}
_,err = stdin.Write([]byte("tmp.txt"))
if err != nil {
fmt.Println(err)
}
stdin.Close()
cmd.Stdout = os.Stdout //终端标准输出tmp.txt
cmd.Start()
}