首页 > 其他 > 详细

golang: impressed by its cross compiling possibilities

时间:2018-07-08 10:16:59      阅读:248      评论:0      收藏:0      [点我收藏+]
GOOS="windows" GOARCH="amd64" go build

However till now golang‘s debug functionality seems far from okay. During debug you cannot print map objects.

And also from debugging related aspects, tool dlv do not support arm arch.

Using an undefined variable can be assigned from function return, or by define.

// The following defines a,b,c
a, b, _ := func()
var c = 1+2

According to this and by go tool link --help, compile statically using:

CGO_ENABLED=0 GOOS=linux go build -a -ldflags -extldflags "-static" .

compiling without debug info using: -ldflags ‘-s -w‘

golang: impressed by its cross compiling possibilities

原文:https://www.cnblogs.com/sansna/p/9279114.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!