We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f19c4f commit 9b69314Copy full SHA for 9b69314
go-note/web.rst
@@ -310,6 +310,18 @@ Go 断点调试器dlv
310
311
- https://yq.aliyun.com/articles/57578
312
313
+Go 跨平台编译
314
+---------------------------------------------------------------
315
+用 Go 你可以选择自己喜欢的操作系统开发,并跨平台编译程序要发布平台的可执行程序即可。
316
+Go 通过两个环境变量控制跨平台编译:
317
+
318
+- GOOS: 代表要编译的目标操作系统,常见的有 Linux, Windows, Darwin 等
319
+- GOARCH: 代表要编译的目标处理器架构,常见的有 386, AMD64, ARM64 等
320
321
+比如现在在用 macOS AMD64 开发,但是想要编译出 Linux AMD64 的可执行程序,只需要执行:
322
323
+`GOOS=linux GOARCH=amd64 go build main.go`
324
325
Go Debug 调试工具
326
---------------------------------------------------------------
327
- go-spew: 用来打印一些复杂结构方便调试 https://github.com/davecgh/go-spew
0 commit comments