Search code examples
goherokubuildpack

Heroku go buildpack : Cannot find import path for my created module


I'm trying to deploy a Go web app to Heroku using this template and this guide. Working great locally, but when I try to deploy with

git push heroku master

I get this error:

remote: Parsing meta tags from https://github.com?go-get=1 (status code 200)
remote: can't load package: package github.com/f4ww4z/sipss: unknown import path "github.com/f4ww4z/sipss": cannot find module providing package github.com/f4ww4z/sipss
remote:  !     Push rejected, failed to compile Go app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to sipss.
remote: 
To https://git.heroku.com/sipss.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sipss.git'

Full log after the deployment command is here.

I see that heroku's actually detected the module github.com/f4ww4z/sipss in the go.mod file (see log link), so why is it throwing this cannot find module providing package github.com/f4ww4z/sipss ?


Solution

  • Looks like your git repo is private. Read this https://github.com/heroku/heroku-buildpack-go#private-git-repos