From 0003ee229fd33ff46cb5f2fe1e35f5c0284debc4 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Wed, 2 May 2012 15:44:51 +0200 Subject: Imported Upstream version 1.0.1 --- src/cmd/go/vcs.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/cmd/go/vcs.go') diff --git a/src/cmd/go/vcs.go b/src/cmd/go/vcs.go index 5f63f8b56..1c121672f 100644 --- a/src/cmd/go/vcs.go +++ b/src/cmd/go/vcs.go @@ -422,11 +422,15 @@ func repoRootForImportPathStatic(importPath, scheme string) (*repoRoot, error) { func repoRootForImportDynamic(importPath string) (*repoRoot, error) { slash := strings.Index(importPath, "/") if slash < 0 { - return nil, fmt.Errorf("missing / in import %q", importPath) + return nil, errors.New("import path doesn't contain a slash") + } + host := importPath[:slash] + if !strings.Contains(host, ".") { + return nil, errors.New("import path doesn't contain a hostname") } urlStr, body, err := httpsOrHTTP(importPath) if err != nil { - return nil, fmt.Errorf("http/https fetch for import %q: %v", importPath, err) + return nil, fmt.Errorf("http/https fetch: %v", err) } defer body.Close() metaImport, err := matchGoImport(parseMetaGoImports(body), importPath) -- cgit v1.2.3