Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How do I run go get on a private repo

I have two Go repos. One called foo - which is a package, and one called bar - which pulls in foo as a dependency.

Because of Go's archaic (a more appropriate description is probably against community guidelines) package management system, you have to specify the full domain name of a package that you pull in - so in my file ``, I have:

import ""

I initially had an issue where I was getting this output

go get reading 403 Forbidden
server response: Access denied. You must have write or admin access.

After looking up the output, several sites told me to run the following to force a connection via SSH:

git config --global url."".insteadOf ""

When I run `go get` to pull in the foo dependency, I now get a slightly different error:

go: downloading v0.1.0
go get verifying module: reading 410 Gone
server response:
not found: reading 403 Forbidden

It does seem to be finding and accessing my foo repo because the latest tag in it is 0.1.0, but the go get command is still failing due to a 403. I know for certain that I don't lack permissions on my SSH key, because I use that SSH key to push to/pull from Bitbucket all the time.



1 answer

1 accepted

6 votes
Answer accepted

Resolved. I had to restart the SSH agent in order for the .gitconfig change to take effect.

I was then faced with the following issue:

main.go:5:2: verifying module: reading 410 Gone

This is something that I'd addressed before - for those facing the same issue,  it's just a matter of exporting a variable to prevent Go from looking up the repo in - as follows:

export GOPRIVATE=""
Giri iyer I'm New Here May 11, 2022

Hi, even with the GOPRIVATE setup correctly, I Still get 410 Gone error and go  checks the still. Any ideas? I am running on Win.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,264 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you