24.部署Go语言代码

理解目标

//为编译程序指定目标系统和体系结构
GOOS = linux GOARCH=386 go build example.go
Goos = windows GOARCH =amd64 go build example.go

image-20210202224145785

image-20210202224201672

压缩二进制文件

可以设置一些标志来压缩二进制文件

GOOS=linux go build -ldflags="-s -w" example.go
© 版权声明
THE END
喜欢就支持以下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容