Skip to content

Commit

Permalink
use build.NoGoError instead of string comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed Sep 14, 2013
1 parent 6e496db commit 37b67b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions match.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ func matchPackages(pattern string) []string {
return nil
}
_, err = buildContext.ImportDir(path, 0)
if err != nil && strings.Contains(err.Error(), "no Go source files") {
return nil
if err != nil {
if _, noGo := err.(*build.NoGoError); noGo {
return nil
}
}
pkgs = append(pkgs, name)
return nil
Expand Down

0 comments on commit 37b67b9

Please sign in to comment.