Update example
git-svn-id: https://svn.yakumo.dev/yakumo.izuru/toyohime/trunk@81 922d331f-388e-da47-97a9-ad700dc0b8b9
This commit is contained in:
parent
dc0dc52f70
commit
bbf68827f0
@ -2,8 +2,16 @@ package vanity
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"go.jonnrb.io/vanity"
|
||||
)
|
||||
|
||||
func ExampleRedirect() {
|
||||
http.Handle("/", Redirect("git", "kkn.fi", "github.com/kare"))
|
||||
// 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.
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user