Invalid version control suffix in bitbucket.org/ path when importing private repo in golang

Viewed 21

The steps I took:

1- Configure .gitconfig

[url "ssh://git@bitbucket.org/"]
    insteadOf = https://bitbucket.org/

2- export GOPRIVATE=bitbucket.org/myproject/helpers-go

3- go get

my go.mod file ->

module bitbucket.org/myproject/x/test-service

go 1.16

require (
    bitbucket.org/myproject/helpers-go v0.0.2
)

replace bitbucket.org/myproject/helpers-go => bitbucket.org/myproject/helpers-go.git v0.0.2
  • My ssh key works. I can push/pull each services.
  • I also have the v0.0.2 tag on my last helpers-go commit.

I am trying to import private repo(helpers-go) into (test-service) and the error I get is :

go: bitbucket.org/myproject/helpers-go@v0.0.2: invalid version control suffix in bitbucket.org/ path

Even if I change the v0.0.2 to something random like v0.0.9 which I don`t have a tag like this, I still get the same error. Appreciate the help...

1 Answers

it is solved:

1- I was using go 1.16 and there was an issue with bitbucket private repos not being supported for this version. I don`t think it has the same issue with gitlab. Upgrading it to go 1.19

2- Small change here .org/ -> .org:

[url "git@bitbucket.org:"]
        insteadOf = https://bitbucket.org/

3- Also making sure the private repo I am importing has a file that ends with .go. My .go files were all in other folders leaving main folder without a .go file.

Related