英文:
Getting errors when linking two golang based repositories and running the golang based server in my local machine
问题
我有两个仓库,dpay-server
和dpay-common
,其中后者是一个包含通用函数的仓库,前者可以使用后者。前者是一个用于启动服务器的Golang服务器代码仓库。
然而,每当我尝试启动服务器时,我都会收到下面代码片段中显示的错误:
starting auth_service...go: github.com/durianpay/dpay-common@v1.20.1-0.20220727064753-c92376be8206: invalid pseudo-version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/pavanvasan/go/pkg/mod/cache/vcs/ac49d8a5c55a9cf6c728a4698e3370e760c9491837da868854c21d77f2e5dd6f: exit status 128:
fatal: pack has 5 unresolved deltas
fatal: fetch-pack: invalid index-pack output
go: downloading github.com/durianpay/dpay-common v1.20.1-0.20220727064753-c92376be8206
go: github.com/durianpay/dpay-common@v1.20.1-0.20220727064753-c92376be8206: invalid pseudo-version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/pavanvasan/go/pkg/mod/cache/vcs/ac49d8a5c55a9cf6c728a4698e3370e760c9491837da868854c21d77f2e5dd6f: exit status 128:
fatal: pack has 5 unresolved deltas
fatal: fetch-pack: invalid index-pack output
我尝试重新克隆仓库,并进行了一些小的调整,比如设置yaml配置,但仍然遇到上述错误。
我按照链接https://stackoverflow.com/questions/58787277/git-cant-pull-or-commit中的命令进行了操作,但没有成功。
即使设置了以下内容也没有起作用:
export GOPRIVATE="github.com/durianpay/dpay-common"
export GIT_TERMINAL_PROMPT=1
我不确定出了什么问题,因为仓库没有损坏。现在我唯一的解决方法是使用replace
命令,例如:
replace github.com/durianpay/dpay-common => /Users/user_name/dpay-common
有人可以给我一个关于出了什么问题以及如何解决这个问题的想法吗?谢谢。
英文:
I have two repositories dpay-server
and dpay-common
with the latter being a common function repository the former can use. The former is a golang server code repository that is used to start the server.
However, whenever I try to start the server, I get the error in the snippet as shown below:
starting auth_service...go: github.com/durianpay/dpay-common@v1.20.1-0.20220727064753-c92376be8206: invalid pseudo-version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/pavanvasan/go/pkg/mod/cache/vcs/ac49d8a5c55a9cf6c728a4698e3370e760c9491837da868854c21d77f2e5dd6f: exit status 128:
fatal: pack has 5 unresolved deltas
fatal: fetch-pack: invalid index-pack output
go: downloading github.com/durianpay/dpay-common v1.20.1-0.20220727064753-c92376be8206
go: github.com/durianpay/dpay-common@v1.20.1-0.20220727064753-c92376be8206: invalid pseudo-version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/pavanvasan/go/pkg/mod/cache/vcs/ac49d8a5c55a9cf6c728a4698e3370e760c9491837da868854c21d77f2e5dd6f: exit status 128:
fatal: pack has 5 unresolved deltas
fatal: fetch-pack: invalid index-pack output
I tried again by recloning the repos once again and after making minor adjustments like setting up yaml configs, I am still getting the above error.
I followed instructions in I followed the commands in the link https://stackoverflow.com/questions/58787277/git-cant-pull-or-commit But to no avail.
Even setting the following did not work either
export GOPRIVATE="github.com/durianpay/dpay-common"
export GIT_TERMINAL_PROMPT=1
I am not sure what is going wrong here since the repository is not corrupted. The only way I can link now is by using the replace
command like:
replace github.com/durianpay/dpay-common => /Users/user_name/dpay-common
Can anyone give me an idea as to what is going wrong and how I can solve this issue? Thanks
答案1
得分: 1
没关系,我找到答案了。看起来我需要删除/go/pkg/mod/cache
才能解决问题。
英文:
Never mind, I got the answer. Looks like I had to remove the /go/pkg/mod/cache
for the problem to be solved.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论