toyohime/example_test.go
jonbetti f00351ef0f Update example
git-svn-id: file:///srv/svn/repo/toyohime/trunk@81 922d331f-388e-da47-97a9-ad700dc0b8b9
2018-06-05 03:04:11 +00:00

18 lines
441 B
Go

package vanity
import (
"net/http"
"go.jonnrb.io/vanity"
)
func ExampleRedirect() {
// Redirects the vanity import path "go.jonnrb.io/vanity" to the code hosted
// on GitHub by user (or organization) "jonnrb" in repo "vanity" using the
// git over "https".
h := vanity.GitHubHandler("go.jonnrb.io/vanity", "jonnrb", "vanity", "https")
http.Handle("/vanity", h)
http.Handle("/vanity/", h) // to handle requests for subpackages.
}