go get a private repo from codecommit

2.8k views Asked by At

I'm new to golang, we are trying to create a package in go and use across all the services we wanted to use.

I tried to create a repo in github and tried to do go get; I didn't get any issue.

Now I wanted to create the same package in codecommit of amazon. I add my ssh in iam of aws, and I'm able to clone.

I ran these commands:

$ git config --global url."ssh://git-codecommit.us-east-2.amazonaws.com:".insteadOf "https://git-codecommit.us-east-2.amazonaws.com/"
$ go get git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package

And I got below error:

package git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package: unrecognized import path "git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package" (parse https://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package?go-get=1: no go-import meta tags ())

Could someone solve my issue with codecommit?

I'm able to do this in github, but I'm getting issue in codecommit.

2

There are 2 answers

1
user226717 On

Try adding '.git' e.g:

$ go get git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package.git
0
R70YNS On

Your second command looks fine,

go get git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package

You just need to add .git to the end of it i.e.

go get git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package.git