Skip to content

Instantly share code, notes, and snippets.

@mishak87
Created April 12, 2015 20:26
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mishak87/db30266a07125de55bd5 to your computer and use it in GitHub Desktop.
Save mishak87/db30266a07125de55bd5 to your computer and use it in GitHub Desktop.
nginx vanity imports for go(lang)
location ~ /(?<namespace>[a-z][a-z0-9]*)/(?<package>[a-z][a-z0-9]*) {
if ($args = "go-get=1") {
add_header Content-Type text/html;
return 200 '<meta name="go-import" content="$host/$namespace/$package git https://git.$host/$namespace/$package">';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment