赞
踩
cmd.go
package main import ( "fmt" "os/exec" ) func main() { deploy("hello") } func deploy(path string) { fmt.Println(path) cmd := exec.Command("bash", "-c", "/usr/bin/cat"+" ./cmd.go") out, err := cmd.CombinedOutput() if err != nil { fmt.Println(err) } fmt.Println(string(out)) }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。