dongzhang6544 2016-06-08 07:59
浏览 72
已采纳

Heroku Golang-找不到命令'main'

I got a Go API up on Heroku to which I push some code; in my procfile I have the following

web: main

In order to launch the Go built binary on Heroku's side. When I build it on my side with

go build cmd/main.go

It produces a binary file namned 'main' in my project root and works as expected but on Heroku I get

app[web.1]: bash: main: No such file or directory

The build process on Heroku seems fine, it finds all my dependencies and installs/compiles it all.

  • 写回答

2条回答 默认 最新

  • douchui4815 2016-06-08 08:09
    关注

    This was super simple once I realised this;

    All main packages in the repo are compiled and binaries placed in the /app/bin directory, which is in the PATH. Binaries are named after the directory that contains them.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?