func breadcrumbPath(pkgPath, modPath, requestedVersion string) breadcrumb {
	if pkgPath == stdlib.ModulePath {
		return breadcrumb{Current: "Standard library"}
	}
	// Obtain successive prefixes of pkgPath, stopping at modPath,
	// or for the stdlib, at the end.
	minLen := len(modPath) - 1
	if modPath == stdlib.ModulePath {
		minLen = 1
	}
	var dirs []string
	for dir := pkgPath; len(dir) > minLen && len(path.Dir(dir)) < len(dir); dir = path.Dir(dir) {
		dirs = append(dirs, dir)
	}
	// Construct the path elements of the result.
	// They will be in reverse order of dirs.
	// The first dir is the current page. If it is the only one, leave it
	// as is. Otherwise, use its base. In neither case does it get a link.
	d := dirs[0]
	if len(dirs) > 1 {
		d = path.Base(d)
	}
	b := breadcrumb{Current: d}
	// Make all the other parts into links.
	b.Links = make([]link, len(dirs)-1)
	for i := 1; i < len(dirs); i++ {
		href := "/" + dirs[i]
		if requestedVersion != internal.LatestVersion {
			href += "@" + requestedVersion
		}
		el := dirs[i]
		if i != len(dirs)-1 {
			el = path.Base(el)
		}
		b.Links[len(b.Links)-i] = link{href, el}
	}
	// Add a "copy" button for the path.
	b.CopyData = pkgPath
	return b
}
// breadcrumbPath builds HTML that displays pkgPath as a sequence of links
// to its parents.
// pkgPath is a slash-separated path, and may be a package import path or a directory.
// modPath is the package's module path. This will be a prefix of pkgPath, except
// within the standard library.
// version is the version for the module, or LatestVersion.
//
// See TestBreadcrumbPath for examples.
breadcrumbPath builds HTML that displays pkgPath as a sequence of links
to its parents.
pkgPath is a slash-separated path, and may be a package import path or a directory.
modPath is the package's module path. This will be a prefix of pkgPath, except
within the standard library.
version is the version for the module, or LatestVersion.

See TestBreadcrumbPath for examples.
// breadcrumbPath builds HTML that displays pkgPath as a sequence of links // to its parents . // pkgPath is a slash - separated path and may be a package import path or a directory . // modPath is the package ' s module path . This will be a prefix of pkgPath except // within the standard library . // version is the version for the module or LatestVersion . // // See TestBreadcrumbPath for examples .
func breadcrumbPath(pkgPath, modPath, requestedVersion string) breadcrumb {
	if pkgPath == stdlib.ModulePath {
		return breadcrumb{Current: "Standard library"}
	}
	minLen := len(modPath) - 1
	if modPath == stdlib.ModulePath {
		minLen = 1
	}
	var dirs []string
	for dir := pkgPath; len(dir) > minLen && len(path.Dir(dir)) < len(dir); dir = path.Dir(dir) {
		dirs = append(dirs, dir)
	}
	d := dirs[0]
	if len(dirs) > 1 {
		d = path.Base(d)
	}
	b := breadcrumb{Current: d}
	b.Links = make([]link, len(dirs)-1)
	for i := 1; i < len(dirs); i++ {
		href := "/" + dirs[i]
		if requestedVersion != internal.LatestVersion {
			href += "@" + requestedVersion
		}
		el := dirs[i]
		if i != len(dirs)-1 {
			el = path.Base(el)
		}
		b.Links[len(b.Links)-i] = link{href, el}
	}
	b.CopyData = pkgPath
	return b
}
func breadcrumbPath ( pkgPath , modPath , requestedVersion string ) breadcrumb { if pkgPath == stdlib . ModulePath { return breadcrumb { Current : " " } } minLen := len ( modPath ) - 1 if modPath == stdlib . ModulePath { minLen = 1 } var dirs [ ] string for dir := pkgPath ; len ( dir ) > minLen && len ( path . Dir ( dir ) ) < len ( dir ) ; dir = path . Dir ( dir ) { dirs = append ( dirs , dir ) } d := dirs [ 0 ] if len ( dirs ) > 1 { d = path . Base ( d ) } b := breadcrumb { Current : d } b . Links = make ( [ ] link , len ( dirs ) - 1 ) for i := 1 ; i < len ( dirs ) ; i ++ { href := " " + dirs [ i ] if requestedVersion != internal . LatestVersion { href += " " + requestedVersion } el := dirs [ i ] if i != len ( dirs ) - 1 { el = path . Base ( el ) } b . Links [ len ( b . Links ) - i ] = link { href , el } } b . CopyData = pkgPath return b }
breadcrumbPath builds HTML that displays pkgPath as a sequence of links
to its parents.
breadcrumbPath builds HTML that displays pkgPath as a sequence of links to its parents .
// Obtain successive prefixes of pkgPath, stopping at modPath, // or for the stdlib, at the end. // Construct the path elements of the result. // They will be in reverse order of dirs. // The first dir is the current page. If it is the only one, leave it // as is. Otherwise, use its base. In neither case does it get a link. // Make all the other parts into links. // Add a "copy" button for the path.