go get on Stash repository

Hello.

I am evaluating Stash 2.12.3 for use as a repository for Go source code packages.  The standard way to retrieve a Go package for use as a dependency of another Go package is to issue "go get" against the host / path part of the Git repository URL.  For example:

$ go get git.example.com/scm/inf/testpackage

where the actual https public repository URL for this package is 

https://git.example.com/scm/inf/testpackage.git

Here is the reference for this technique:  https://golang.org/doc/code.html#remote

However, when I execute this go get command against my Stash repository, I get this:

$ go get git.example.com/scm/inf/testpackage

package git.example.com/scm/inf/testpackage: unrecognized import path "git.example.com/scm/inf/testpackage"

 

tcpflow for this interaction shows (after https fails, go-get falls back to http, where we can see this output) this


010.001.035.008.49712-010.007.024.054.00080: GET /scm/inf/testpackage?go-get=1 HTTP/1.1
Host: git.example.com
User-Agent: Go 1.1 package http
Accept-Encoding: gzip


write error to stdout

010.007.024.054.00080-010.001.035.008.49712: HTTP/1.1 501 Not Implemented
Server: Apache-Coyote/1.1
X-AREQUESTID: 681x2525072x2
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Content-Length: 109
Date: Mon, 27 Jul 2015 18:21:32 GMT
Connection: close

Invalid request from host 10.7.24.252: Note that Stash does not support Git's legacy HTTP transport protocol.
write error to stdout

 

Does Stash support what go-get is trying to do?  github.com, does, of course, as a large number of developers working Go know.

 

Thanks for your help.

Mark

 

 

1 answer

5 votes

Hi Mark,

https://jira.atlassian.com/browse/STASH-5380

Support for go get on a Stash repository was added in 3.8.0. From this version of Stash onward, you should be able to go get a package by

go get {hostname}/{project_key}/{repository_slug}

Prior to 3.8.0, you are still able to use go get, but must specify the full HTTP/S URL, with VCS suffix, i.e.

go get {hostname}/scm/{project_key}/{repository_slug}.git

Kind regards,
Stefan Petrucev
Atlassian Stash

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,453 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you