I'm trying to get a specific package from github for a project.
However, when I use go get [url]
or go mod vendor
, I get a git fetch error for lack of permissions to one of my company's repos. This repo is vendored, which is how we get around it for go test, go build etc.
This is the error message:
go: private.work.repo.com/project/[email protected]: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in C:\Users\NICHOLAS.TAN\go\pkg\mod\cache\vcs\37594aeb10b98234e04b4780cf59f32c4ad7bb9da460f552103ae748cea73aa1: exit status 128:
fatal: remote error: Repository not found
The requested repository does not exist, or you do not have permission to
access it.
Is there a way for me to use go get
and/or go mod vendor
without those commands trying to look at the other module dependencies?
go get <package name>
for packages you need? – Millennialgo env
? – CobosGOPRIVATE=*.corp.com go get [url]
would exclude*.corp.com
from go modules proxy which is a common reason for fetch problems from private repos. – Divergentgit.companyname.com/project/....
and I am using commandgo get [url] GOPRIVATE=*companyname.com
– NancynandorGOPRIVATE=*.companyname.com go get [url]
orexport GOPRIVATE=*.companyname.com
once before doing go get. – Divergent