Golang binary to Geroku
I made a Golang app and I have no problem getting it working on Heroku using buildpack, but now I would like to distribute the compiled program to others without source code.
Is it possible to get a binary on Heroku without source code, or does Heroku need the source code to create its own compiled version?
source to share
The Heroku buildpack for Go doesn't do anything special: it just calls the Go tool to compile the binary based on whether you are using gods or not.
Just call go build
your directory package main
or go build repo.com/you/yourmainpackage
to output a binary that you can redistribute.
Also, you will want to see this buildpack if you want others to execute the provided binary on Heroku: https://github.com/ph3nx/heroku-binary-buildpack - make sure the binary was compiled for amd64 Linux if you targeting Heroku.
source to share