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 }