I am using http://github.com/tmthrgd/go-bindata to embed static files and templates within Go executable file. It requires to run go generate
to run a Go code that read each file and write binary representation as standard go file. go generate
have to be fired before build process. Is there a chance to configure Heroku to handle this?
go generate
should be run locally while developing, not on heroku. If you run it on heroku it will lead to very hard to debug issues. If go generate
has unexpected results you wont be able to easily inspect this.
You could run go generate
with a tool like modd or with a git hook. Having the results of go generate
tracked by git also means that you can track which changes affected generated code.
In a language like ruby it might be customary to run bundle install
on the server and omit dependencies from git. For go programs this is not so. Dependencies should be vendored and tracked by git. Same for generated code.
The rest is not at all advised for this case and I would never do something like this.
go generate