dounue6984 2015-06-28 09:09
浏览 47
已采纳

Heroku上的Golang二进制文件

I've made a Golang application and I've no problem getting it to work on Heroku using the buildpack but now I would like to distribute the compiled program to others without the source code.

Is it possible to get the binary working on Heroku without the source code or does Heroku need the source code to create its own compiled version?

  • 写回答

1条回答 默认 最新

  • dougou1943 2015-06-28 09:58
    关注

    The Heroku buildpack for Go doesn't do anything special: it just calls out to the Go tool to compile the binary based on whether you use godeps or not.

    Just call go build in the directory of your package main or go build repo.com/you/yourmainpackage to output a binary you can distribute.

    In addition, you'll want to see this buildpack if you want to have others run a provided binary on Heroku: https://github.com/ph3nx/heroku-binary-buildpack — make sure the binary has been compiled for amd64 Linux if you are targeting Heroku.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Pyqt 如何正确的关掉Qthread,并且释放其中的锁?
  • ¥30 网站服务器通过node.js部署了一个项目!前端访问失败
  • ¥15 WPS访问权限不足怎么解决
  • ¥15 java幂等控制问题
  • ¥15 海湾GST-DJ-N500
  • ¥15 氧化掩蔽层与注入条件关系
  • ¥15 Django DRF 如何反序列化得到Python对象类型数据
  • ¥15 多数据源与Hystrix的冲突
  • ¥15 如何在线硕士了解,广告太多,希望有真实接触过的人回答下?(标签-学习|关键词-在线硕士)
  • ¥15 zabbix6.4与frp如何进行联动