Skip to content

๐Ÿ”„ Redirects go-get requests for a custom domain name

License

Notifications You must be signed in to change notification settings

gentlecat/go-get-redirect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

go-get-redirect

This tool allows you to vend your Go packages via a custom domain name. It generates a static website for redirection purposes by scanning a given GitHub account for public Go repos. Current implementation is based around GitHub account and generating a static website using Actions.

This is useful when you don't want to run a server that does the redirection. If you do have a server to run this on, then you could set up something like this with nginx:

location ~ ^/([^/]+).*$ {
	if ($args = "go-get=1") {
		add_header Content-Type text/html;
		return 200 '<meta name="go-import" content="$host/$1 git https://github.com/USERNAME/$1.git">';
	}
	return 302 https://github.com/USERNAME/$1;
}

Additional information about how this works can be found here.

About

๐Ÿ”„ Redirects go-get requests for a custom domain name

Topics

Resources

License

Stars

Watchers

Forks