Index | Files

package godoc

import ""

Package godoc serves redirects to, including “go get” headers.


Package Files


func Redirect Uses

func Redirect(vcs, importPath, repoPath string) http.Handler

Redirect returns an HTTP handler that redirects requests for the tree rooted at importPath to pages for those import paths. The redirections include headers directing “go get” to satisfy the imports by checking out code from repoPath using the given version control system.

As a special case, if both importPath and repoPath end in /*, then the matching element in the importPath is substituted into the repoPath specified for “go get.”

For example, the top-level directories at maps to individual GitHub repositories under, by using:

http.Handle("/", godoc.Redirect("git", "*", "*"))

As another example, import paths starting with map to the single GitHub repository, by using:

http.Handle("/go/", godoc.Redirect("git", "", ""))

Package godoc imports 5 packages (graph). Updated 2018-02-21. Refresh now. Tools for package owners.