How to safely reduce the binaries size when using go 1.7.1?

agolangf · · 583 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I found this article <a href="https://jamescun.com/golang/binary-size/" rel="nofollow">https://jamescun.com/golang/binary-size/</a> but I wonder if it&#39;s still relevant.</p> <hr/>**评论:**<br/><br/>distrus: <pre><p>My go-to article for shrinking binaries is <a href="https://blog.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/" rel="nofollow">this one</a>.</p></pre>mcouturier: <pre><p>For me ever since go 1.7 when I use UPX I get a segfault when I start my server (xcompiling from OSX to Linux)</p> <p>EDIT: it seems that combining the -s -w ldflags -and- using UPX fixed my issue on one of my project but not the other</p> <p>EDIT2: segfault not core dump</p></pre>stackmutt: <pre><p>Try it?</p></pre>: <pre><p>[deleted]</p></pre>beluga1987: <pre><p>Just how many go binaries should I build in order to <strong>test</strong> it?</p></pre>THEHIPP0: <pre><p>If stripping goes wrong the binary usually doesn&#39;t even start. That was at least my experience.</p></pre>beluga1987: <pre><p>I stripped too, but it&#39;s always that big <strong>if</strong>. I hope that, for example, strip will always work in the near future. It would be great if we could find more information about it on <a href="https://golang.org/" rel="nofollow">https://golang.org/</a>.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

583 次点击  ∙  1 赞  
加入收藏 微博
1 回复  |  直到
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传