我正在尝试使用 this template 将 Go 网络应用程序部署到 Heroku和 this guide .在本地工作得很好,但是当我尝试使用
进行部署时git push heroku master
我收到这个错误:
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'
deployment command is here 之后的完整日志.
我看到 heroku 实际上在 go.mod
文件中检测到模块 github.com/f4ww4z/sipss
(参见日志链接),那么为什么它会抛出这个找不到提供包 github.com/f4ww4z/sipss 的模块
?
最佳答案
看起来您的 git 存储库是私有(private)的。阅读此 https://github.com/heroku/heroku-buildpack-go#private-git-repos
关于go - Heroku 去构建包 : Cannot find import path for my created module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57613057/