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 Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,914 views 7 10
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