I'm trying to go get
a private Bitbucket package. But when doing so, I receive the following error message:
go: bitbucket.org/project/package: reading https://api.bitbucket.org/2.0/repositories/project/package?fields=scm: 403 Forbidden
server response: Access denied. You must have write or admin access.
I tried to set git config --global url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
, in combination with go env -w GOPRIVATE=bitbucket.org/project
. but that didn't work.
So I tried setting git config --system url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
. that didn't work either.
Finally I tried setting GOPRIVATE manually by writing export GOPRIVATE=bitbucket.org/project
in ~/.bashrc
. didn't work.
Important to know that I've confirmed that SSH is working correctly by pulling/pushing code from/to private repos.