Getting errors when linking two golang based repositories and running the golang based server in my local machine

huangapple go评论85阅读模式
英文:

Getting errors when linking two golang based repositories and running the golang based server in my local machine

问题

我有两个仓库,dpay-serverdpay-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.

huangapple
  • 本文由 发表于 2022年7月28日 18:43:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/73151506.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定