前提・実現したいこと
Go言語で記述した web アプリケーションコードを heroku に push する際に、以下のようなエラーが発生して失敗してしまいます。
アプリケーションのルートディレクトリにgo.mod
ファイルがあれば、go で記述されたアプリケーションであると認識されると思っていたのですが、何か不足している処理や間違っている箇所があるのでしょうか。
発生している問題・エラーメッセージ
$ git push heroku master Counting objects: 240, done. Delta compression using up to 4 threads. Compressing objects: 100% (217/217), done. Writing objects: 100% (240/240), 72.73 KiB | 709.00 KiB/s, done. Total 240 (delta 98), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/go.tgz remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to myapp. remote: To https://git.heroku.com/myapp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/myapp.git'
該当のソースコード
- go.mod
module myapp go 1.12 require ( github.com/Bowery/prompt v0.0.0-20190419144237-972d0ceb96f5 // indirect github.com/dgrijalva/jwt-go v0.0.0-20180921172315-3af4c746e1c2 github.com/go-sql-driver/mysql v1.4.1 ... )
- Procfile
web: bin/myapp
実行したコマンド
heroku buildpacks:set heroku/go go build -o bin/myapp -v . git commit
補足情報(FW/ツールのバージョンなど)
go v1.12
足りない情報がありましたら教えていただけると幸いです。
あなたの回答
tips
プレビュー