当前位置:网站首页>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创建索引
- solidity转账函数的实现(基于transfer)
- Brief introduction to the principle of spectrometer II
- MongoDB数据库shell命令执行
- 【译】创意编码之噪音
- Food safety | will the salt content of bread exceed the standard? A few tips to teach you to eat bread correctly!
- Import the database backup of MySQL 8 into MySQL 5
- Leetcode79 method 1: deep search
- Video number one video broadcast 260million
- Detailed explanation of oscilloscope parameters
猜你喜欢

Wired: who owns the art of the future? Openai allows dall-e users to commercialize their works. At present

Principle, classification and requirements of antenna

Brief introduction to the principle of spectrometer I

低码在数字化转型中扮演什么角色?

USB Type-C 之CC线简介

频谱分析仪的性能参数

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

Brief introduction: basic principle of srv6

互联智能,如何定义下一代网络变革

Mqtt over quic: the next generation Internet of things standard protocol injects new impetus into the message transmission scenario
随机推荐
Experimental building - PHP Dafa
Introduction to main parameters of antenna
USB Type-C PD快充简介
Iptables firewall port rule configuration
频谱仪原理简介二
The diversion between video number and official account is convenient and considerable
示波器探头详解
Categories with good sales volume on the video Number
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
DC simulation example of ADS simulation
Cloud container and cloud native
Summary of core knowledge points of Computer Composition Principles & key points of written interview [easy to understand]
Composition and principle of vector network analyzer (vector network)
solidity转账函数的实现(基于transfer)
Implementation of solid transfer function (based on transfer)
一文简述:SRv6基本原理
NDK series (5): from introduction to practice, JNI explodes the liver and explains everything in detail!
Yu Chengdong: Huawei is trying to cope with the US chip ban