Friday, May 29, 2015

Make you Repository for Go-Gettable!

Maybe your company is using Go, and you cannot publish your software to public repositories because the code is classified.

You can add to your company repository the same functionality that allows Github and others to make you fetch the packages with go get using the information from Remote import paths documentation.

It's pretty simple, the only modification you have to do is add a meta tag in the project page of your source code management software (like Kallithea or RhoCode).

<meta name="go-import" content="yourserver/your/package git https://yourserver/your/package">

This tag tells go that the import path yourserver/your/package is a git repository located at https://yourserver/your/package

Now you can simply use go get yourserver/your/package and you will find your package in the yourserver/your/package directory in $GOPATH/src.

No comments:

Post a Comment