Golang 编译命令须远 收录于 开发 2018-04-18 约 73 字 预计阅读 1 分钟 | 编辑目录 交叉编译交叉编译Mac 下编译1 2 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go Linux 下编译1 2 3 4 # mac CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go # windows CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go Windows 下编译 1 2 3 4 5 6 7 8 9 10 11 # mac SET CGO_ENABLED=0 SET GOOS=darwin SET GOARCH=amd64 go build main.go #linux SET CGO_ENABLED=0 SET GOOS=linux SET GOARCH=amd64 go build main.go Please enable JavaScript to view the comments powered by Disqus.