2022年4月2日
摘要: 1、import C必须紧跟上面的C代码。c代码需要//和/* */包含起来 2、C调用go的接口,需要在go的接口前面调用//export //export go_print func go_print(value string) { fmt.Println(value) } 3、multiple 阅读全文
posted @ 2022-04-02 16:29 莱芜梆子 阅读(680) 评论(0) 推荐(0) 编辑
摘要: 解决方法: 1.输出重定向,用run执行,output会获取内容,run只是执行,out, err := exec.Command("/bin/sh", "-c", “test.sh”).Output() func main() { f, _ := os.Create("1.txt") cmd := 阅读全文
posted @ 2022-04-02 10:38 莱芜梆子 阅读(851) 评论(0) 推荐(0) 编辑