You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modify the configuration to be able to download private projects from private gitlab repositories
Approach 1
$ go env -w GOPRIVATE=a.b.com
$ go env -w GOINSECURE=a.b.com
$ go get a.b.com/testgroup/compkg
Approach 2
$ git config --global url."git@a.b.com:testgroup/compkg.git".insteadOf "https://a.b.com/testgroup/compkg"
$ go get a.b.com/testgroup/compkg
Approach 3
$ vim ~/.netrc
machine a.b.com
username abcd
password private-token
PS: testgroup is groupname not username in gitlab
What did you expect to see?
I can download private project successfullly and use it import
What did you see instead?
go get failed, the error is as follows
$ go get -v -x a.b.com/testgroup/testpkg
# get https://a.b.com/?go-get=1
# get https://a.b.com/testgroup/testpkg?go-get=1
# get https://a.b.com/testgroup?go-get=1
# get https://a.b.com/testgroup?go-get=1: 404 Not Found (0.044s)
# get https://a.b.com/?go-get=1: 403 Forbidden (0.044s)
# get https://a.b.com/testgroup/testpkg?go-get=1: 404 Not Found (0.044s)
# get https://a.b.com/testgroup/testpkg?go-get=1
# get https://a.b.com/testgroup?go-get=1
# get https://a.b.com/?go-get=1
# get https://a.b.com/testgroup/testpkg?go-get=1: 404 Not Found (0.001s)
# get https://a.b.com/testgroup?go-get=1: 404 Not Found (0.001s)
# get https://a.b.com/?go-get=1: 403 Forbidden (0.002s)
go get: unrecognized import path "a.b.com/testgroup/testpkg": reading https://a.b.com/testgroup/testpkg?go-get=1: 404 Not Found
I used the following curl command to return the following error:
$ curl --insecure https://a.b.com/testgroup/compkg?go-get=1
...
404 Not Found
...
The text was updated successfully, but these errors were encountered:
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
For the record I've been having a very similar problem with go get
(I am considering filing an issue, but I am appending this here in case anyone finds this helpful)
go version
go version go1.21.4 linux/arm64
The issue was "fixed" by changing the go.mod of the project I have hosted privately to be
module shanehowearth.com/my/project.git
...
and
go get shanehowearth.com/my/project.git
Note: The Proxy info still needs to be set
No amount of .gitconfig fu would get go get to fetch the repository that is hosted on my on servers
I consider it an issue because there seems to be no /logical/ reason that go get should require the module to be named *.git in order for ssh to be used to fetch it
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Modify the configuration to be able to download private projects from private gitlab repositories
Approach 1
Approach 2
Approach 3
$ vim ~/.netrc machine a.b.com username abcd password private-token
What did you expect to see?
I can download private project successfullly and use it
import
What did you see instead?
go get
failed, the error is as followsI used the following curl command to return the following error:
The text was updated successfully, but these errors were encountered: