码迷,mamicode.com
首页 > 其他好文 > 详细

golang: impressed by its cross compiling possibilities

时间:2018-07-08 10:45:22      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:win   rom   cti   obj   tool   ring   href   str   during   

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

标签:win   rom   cti   obj   tool   ring   href   str   during   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!