Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

Commit

Permalink
context: skip node_modules directory
Browse files Browse the repository at this point in the history
Fixes #187
  • Loading branch information
kardianos committed Aug 4, 2016
1 parent 05c29f6 commit b554613
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions context/resolve.go
Expand Up @@ -42,16 +42,24 @@ func (ctx *Context) loadPackage() error {
if info == nil {
return err
}
if !info.IsDir() {
_, err = ctx.addFileImports(path, ctx.RootGopath)
return err
}
name := info.Name()
// Still go into "_workspace" to aid godep migration.
if info.IsDir() && (name[0] == '.' || name[0] == '_' || name == "testdata") && name != "_workspace" {
if name == "_workspace" {
return nil
}
switch name[0] {
case '.', '_':
return filepath.SkipDir
}
if info.IsDir() {
return nil
switch name {
case "testdata", "node_modules":
return filepath.SkipDir
}
_, err = ctx.addFileImports(path, ctx.RootGopath)
return err
return nil
})
if err != nil {
return err
Expand Down

0 comments on commit b554613

Please sign in to comment.