go 语言 项目代码生成 exe执行程序命令

linux运行的: 

$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build .

运行:-virtual-machine:~/go/bb/aa$       nohup ./ftp       ( liunx中可执行程序下面  nohup ./ftp   ftp为名称  )

window运行的:

$ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build .

运行: cmd打开 -->直接到exe文件夹  --> 直接执行exe名称(记得加.exe)--> 回车ok
 

猜你喜欢

转载自blog.csdn.net/weixin_44282540/article/details/109067483