当前位置:网站首页>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边栏推荐
- Mongodb initialization operation
- Categories with good sales volume on the video Number
- Calibration of vector network analyzer (vector network)
- 矢量网络分析仪(矢网)组成和原理简介
- 新手记录:机械键盘的一些小知识
- Brief introduction to the principle of spectrometer I
- USB Type-C PD快充简介
- Introduction to the principle of signal source
- MongoDB初始化操作
- Mysql操作大全
猜你喜欢

示波器简介

示波器探头详解

Internet intelligence, how to define the next generation network transformation

Introduction to advanced design system (ads) 2009 RF simulation

频谱分析仪的性能参数

Food safety | will the salt content of bread exceed the standard? A few tips to teach you to eat bread correctly!

NDK series (5): from introduction to practice, JNI explodes the liver and explains everything in detail!

连线:谁拥有未来的艺术?OpenAI允许Dall-E用户将作品商用化,目前而言

Introduction to CC cable of USB type-C

矢量网络分析仪(矢网)组成和原理简介
随机推荐
The required error of solidity is reported
频谱分析仪的性能参数
Answer questions about the pixel, resolution and size of the picture, as well as the display size of the monitor.
.net swagger
腾讯汤道生:开源是产业互联网时代新的生产方式和协作模式
Random talk on GIS data (VI) - projection coordinate system
Detailed explanation of oscilloscope parameters
矢量网络分析仪(矢网)的校准
SMIC's net profit in the first half of the year was 1.386 billion yuan, and the n+1 process has entered the stage of customer product verification
Cout.write learning
Five key considerations for network security budget planning in 2023
信号源原理简介
Detailed explanation of oscilloscope probe
Novice record: some small knowledge of mechanical keyboard
USB Type-C 之CC线简介
Food safety | will the salt content of bread exceed the standard? A few tips to teach you to eat bread correctly!
Details of iptables firewall
VSC writes go, expected 'package' appears, found 'EOF‘
Detailed explanation of network RJ45 interface
haproxy实现灰度发布