当前位置:网站首页>Golang 打包发布到各个平台
Golang 打包发布到各个平台
2022-07-28 17:04:00 【谱写】
使用Golang方便之处就在于可以直接打包二进制文件
不需要配置Golang的环境和依赖就可以直接跑起来
以及性能提升比Java好,所以我部分项目是使用Golang开发开发环境:
- Windows 10
- GoLand 2020.2
- Go 1.15.1
打包发布到Centos
set GOOS=linux
set GOARCH=amd64
# open in Terminal
go build main.go
go build ./ 多文件时 打包发布到Windows
set GOOS=windows
set GOARCH=amd64
# open in Terminal
go build main.go
go build ./ 多文件时打包可附加参数
-v 编译时显示包名
-p n 开启并发编译,默认情况下该值为 CPU 逻辑核数
-a 强制重新构建
-n 打印编译时会用到的所有命令,但不真正执行
-x 打印编译时会用到的所有命令
-race 开启竞态检测支持的OS跟ARCH
go tool dist list
aix/ppc64
android/386
android/amd64
android/arm
android/arm64
darwin/amd64
darwin/arm64
dragonfly/amd64
freebsd/386
freebsd/amd64
freebsd/arm
freebsd/arm64
illumos/amd64
js/wasm
linux/386
linux/amd64
linux/arm
linux/arm64
linux/mips
linux/mips64
linux/mips64le
linux/mipsle
linux/ppc64
linux/ppc64le
linux/riscv64
linux/s390x
netbsd/386
netbsd/amd64
netbsd/arm
netbsd/arm64
openbsd/386
openbsd/amd64
openbsd/arm
openbsd/arm64
plan9/386
plan9/amd64
plan9/arm
solaris/amd64
windows/386
windows/amd64
windows/arm边栏推荐
- vmware虚拟机联网设置(win10自带虚拟机安装win7)
- 深圳线下报名|StarRocks on AWS:如何对实时数仓进行极速统一分析
- Mongodb create index
- [untitled]
- 多线程与高并发—— 源码解析 AQS 原理
- Introduction to oscilloscope
- VSC writes go, expected 'package' appears, found 'EOF‘
- Internet intelligence, how to define the next generation network transformation
- DC simulation example of ADS simulation
- Application of Internet of things in smart city
猜你喜欢

The growth path of hardware engineers (0) -- Understanding components

Live broadcast starrocks technology insider: low base global dictionary optimization

DC-DC开关电源

Mqtt over quic: the next generation Internet of things standard protocol injects new impetus into the message transmission scenario

Introduction to advanced design system (ads) 2009 RF simulation

TCP/IP详细图解

矢量网络分析仪(矢网)的校准

实验楼----PHP大法

微信公众号授权登录后报redirect_uri参数错误的问题

Brief introduction to the principle of spectrometer II
随机推荐
七个步骤,深入解读数据含义
haproxy实现代理配置
Video number from 2-3 games per week to 3 games per day
The US ban on Huawei began to affect European chip manufacturers
Live broadcast starrocks technology insider: low base global dictionary optimization
About the difference between root and alias under localization
Busybox latest version (busybox APK)
Details of iptables firewall
Outdoor activities in hot weather are exquisite! Here comes the safety guide for citizens' fitness in midsummer
solidity转账函数的实现(基于transfer)
Syntax error: non declaration statement outside function bodygo and syntax error: unexpected {, expect
实验楼----PHP大法
Detailed explanation of oscilloscope parameters
USB type-C details
.net swagger
1.08 billion dollars! TCL technology acquires Samsung Suzhou 8.5 generation line: the production capacity will increase by 60% in the next year!
cout.write的学习
C WPF normal project suddenly prompts that the name "initializecomponent" does not exist in the current context
Random talk on GIS data (VI) - projection coordinate system
深圳线下报名|StarRocks on AWS:如何对实时数仓进行极速统一分析