3

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.

rassar
  • 5,412
  • 3
  • 25
  • 41
Sreenath
  • 480
  • 2
  • 6
  • 17
  • 1
    Possible duplicate of [What's the proper way to "go get" a private repository?](https://stackoverflow.com/questions/27500861/whats-the-proper-way-to-go-get-a-private-repository) – Jonathan Hall Nov 14 '18 at 11:38
  • Tried this already, https://stackoverflow.com/questions/38668444/go-get-private-repo-from-bitbucket/38672481#38672481 I'm getting above error – Sreenath Nov 14 '18 at 11:45
  • it looks like go-get is automatically using https:// instead of ssh:// – Major Nov 14 '18 at 18:28

2 Answers2

0

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

R70YNS
  • 9
  • 1
0

Try adding '.git' e.g:

$ go get git-codecommit.us-east-2.amazonaws.com/v1/repos/my-package.git
user226717
  • 11
  • 1
  • While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Jun 09 '21 at 06:05