First of all my version of GO is 1.17 when trying to compile a project in GO, go.mod tries to access github dependencies but I get the following error when compiling github.com/xxxxx/xxxxx/go.mod at revision v0.0.2: unknown revision v0.0.2
looking for I found this similar problem on the internet with possible solutions with which I tried all but without success, the guides are the following:
- https://golang.cafe/blog/how-to-fix-go-mod-unknown-revision.html
- go build can't find a revision
- https://medium.com/@manoj.dec22/import-private-go-modules-from-gitlab-71665daa9f9
- https://travis-ci.community/t/sudden-golang-dependency-fetch-failures/8862
Taking this into account, apply the following recommendations:
locate my GOPRIVATE = gitlab.com / myrepo / *
git config --global url. "git@github.com:" .insteadof = "https://github.com"
go clean -modcache && go mod tidy
go mod download all
go list -m all
go env -w GO111MODULE = on
my go env is like this go env
GONOPROXY= "github.com/repo"
GONOSUMBDB ="github.com/repo"
GOPRIVATE = "github.com/repo"
In addition to that I did the Uninstall of Go and reinstalled it thinking that I have something wrong in my Go environment as this did not work, the other thing that occurred to me was to delete my SSH key from github and my local SSH and configure it from zero again, following this guide: https://docs.github.com/es/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and- adding-it-to-the-ssh-agent # generating-a-new-ssh-key Clarifying that the repos of the project dependencies in which it throws error I can clone without any problem, I don't know what I can do more, I come to you to give me an idea how I can solve this mishap in advance, thank you very much