本地进口非本地包装 [英] Local import in non-local package
问题描述
我知道应避免本地进口,但在这种情况下,特殊情况需要。这是一个私人回购,并且由于在服务器上缺少私钥,在使用绝对URL时,heroku buildpack在 go get ./...
阶段失败。 / p>
现在我在非本地程序包中得到此错误本地导入..。
所有导入路径都更改为本地版本,那么仍然可以将软件包限定为非本地?我该如何解决这个问题?解决方案
解决方案
我修正了它。问题是根包在 $ GOPATH / src /< host> /< user> /< package>
中。只要我将包移动到〜/ Git /< package>
,错误消失了(因此,使其成为本地)。 b
I know local imports should be avoided, however special circumstances demand it in this case. It's a private repo, and the heroku buildpack fails in the go get ./...
phase when used with absolute urls, due to a missing private key on the server.
Now I get this error local import ".." in non-local package
.
All import paths were changed to the local version so what remains that qualifies a package as "non-local"? How do I fix this?
I fixed it. The issue was that the root package was in $GOPATH/src/<host>/<user>/<package>
. As soon as I moved the package to ~/Git/<package>
the errors were gone (thus, "made it local").
这篇关于本地进口非本地包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!