Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #76 from sergeylanzman/master
Browse files Browse the repository at this point in the history
fix bug with local package in subdirectories
  • Loading branch information
mattn committed Mar 19, 2016
2 parents 6ffc831 + 00af097 commit 183c76e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
gom
_vendor/**
.idea
8 changes: 1 addition & 7 deletions gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ script:
return nil
}

// http://code.google.com/p/go/source/browse/src/cmd/go/pkg.go?name=go1.1.2#96
func isStandardImport(path string) bool {
return !strings.Contains(path, ".")
}

func appendPkg(pkgs []string, pkg string) []string {
for _, ele := range pkgs {
if ele == pkg {
Expand All @@ -60,10 +55,9 @@ func scanDirectory(path, srcDir string) (ret []string, err error) {
if err != nil {
return ret, err
}

for _, imp := range pkg.Imports {
switch {
case isStandardImport(imp):
case pkg.Goroot:
// Ignore standard packages
case !build.IsLocalImport(imp):
// Add the external package
Expand Down

0 comments on commit 183c76e

Please sign in to comment.