From 157f8abbbd7c19e90432c72cb6216cf0b9324c55 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Mon, 28 Dec 2015 21:19:58 -0800 Subject: [PATCH] go/vcs: accept domain.root in RepoRootForImportDynamic This is the same change as in https://golang.org/cl/12193. Fixes golang/go#13506. Related to golang/go#9357. Change-Id: I9c7d956008641b1907e14bcb08198235f5f9552f Reviewed-on: https://go-review.googlesource.com/18152 Reviewed-by: Russ Cox --- go/vcs/vcs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/vcs/vcs.go b/go/vcs/vcs.go index c1d0ecd0e5..a70249661b 100644 --- a/go/vcs/vcs.go +++ b/go/vcs/vcs.go @@ -478,11 +478,11 @@ func RepoRootForImportPathStatic(importPath, scheme string) (*RepoRoot, error) { // RepoRootForImportDynamic finds a *RepoRoot for a custom domain that's not // statically known by RepoRootForImportPathStatic. // -// This handles "vanity import paths" like "name.tld/pkg/foo". +// This handles custom import paths like "name.tld/pkg/foo" or just "name.tld". func RepoRootForImportDynamic(importPath string, verbose bool) (*RepoRoot, error) { slash := strings.Index(importPath, "/") if slash < 0 { - return nil, errors.New("import path doesn't contain a slash") + slash = len(importPath) } host := importPath[:slash] if !strings.Contains(host, ".") {