Browse Source

fixed bug for windows

pull/103/head
Lunny Xiao 11 years ago
parent
commit
56f5a6bce1
  1. 15
      cmd/gopath.go

15
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 !doc.IsGoRepoPath(name) {
if builds != nil { if builds != nil {
if info, ok := builds[name]; ok { if info, ok := builds[name]; ok {
// Check version. // Check version. there should chek
if i := strings.Index(info, ":"); i > -1 { // local first because d:\ contains :
if com.IsDir(info) {
pkgs[name] = &doc.Pkg{ pkgs[name] = &doc.Pkg{
ImportPath: name, ImportPath: name,
Type: info[:i], Type: doc.LOCAL,
Value: info[i+1:], Value: info,
} }
continue continue
} else if com.IsDir(info) { } else if i := strings.Index(info, ":"); i > -1 {
pkgs[name] = &doc.Pkg{ pkgs[name] = &doc.Pkg{
ImportPath: name, ImportPath: name,
Type: doc.LOCAL, Type: info[:i],
Value: info, Value: info[i+1:],
} }
continue continue
} }

Loading…
Cancel
Save