Can I make Stash provide Go packages?
For example, I'd like import code as follows:
import "my.host/key/repo"
This page describes how to add such support: http://golang.org/cmd/go/#hdr-Remote_import_paths
Hi George,
Yep! You can. You just need to use the HTTP/S URL in your import statement, i.e.:
import "{hostname}/scm/{project_key}/{repository_slug}.git"
For example, to import the repository "newmath" from the project "TEST" on https://stash.atlassian.com I used:
import "stash.atlassian.com/scm/test/newmath.git"
There does seem to be a deficiency in Go that prevents you from having ~ in the URL, which means you won't be able to use packages hosted in personal repositories (as they contain /~username/) but repositories hosted in projects work just fine.
GO nuts
cheers,
Tim
This solution does "work", but is far from desirable IMO. The scm in the path can be omitted. The problem is that all your directories will have .git in them as a suffix. It would be really nice to see Atlassian have real support using the http header solution.
https://jira.atlassian.com/browse/STASH-5380 Vote and or comment.
Don't like the .git suffix in folders. Stash should add the go meta tag in response.
I also don't like .git and /scm/.
The good package path is: import "{hostname}/{project_key}/{repository_slug}"
The extra stuff required in the path when working with go projects in Atlasssian does indeed drive me nuts, so "GO nuts" is a perfect directive. ;-) Any chance we might see a stash improvement in this area soon?
Further support forĀ go get was added in Stash 3.8.0.
go get
https://jira.atlassian.com/browse/STASH-5380
Kind regards,Stefan PetrucevAtlassian Stash
It looks like you're new here. Sign in or register to get started.