From 56f5a6bce1d397ddfae05cf337916c8c55ba8d9f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 10 Dec 2013 18:04:28 +0800 Subject: [PATCH] fixed bug for windows --- cmd/gopath.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/gopath.go b/cmd/gopath.go index 305ab1eba..124906e77 100644 --- a/cmd/gopath.go +++ b/cmd/gopath.go @@ -44,19 +44,20 @@ func getGopmPkgs(dirPath string, isTest bool) (pkgs map[string]*doc.Pkg, err err if !doc.IsGoRepoPath(name) { if builds != nil { if info, ok := builds[name]; ok { - // Check version. - if i := strings.Index(info, ":"); i > -1 { + // Check version. there should chek + // local first because d:\ contains : + if com.IsDir(info) { pkgs[name] = &doc.Pkg{ ImportPath: name, - Type: info[:i], - Value: info[i+1:], + Type: doc.LOCAL, + Value: info, } continue - } else if com.IsDir(info) { + } else if i := strings.Index(info, ":"); i > -1 { pkgs[name] = &doc.Pkg{ ImportPath: name, - Type: doc.LOCAL, - Value: info, + Type: info[:i], + Value: info[i+1:], } continue }