go get on Stash repository


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 


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 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 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 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.




1 answer

5 votes

Hi Mark,


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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

716 views 0 4
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot