Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Ignore dirs with invalid source files #51

Merged
merged 1 commit into from
Sep 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,7 @@ func scanForPackages(dir string) ([]*build.Package, error) {

pkg, err := buildContext.ImportDir(dir, 0)
if err != nil {
switch err.(type) {
case *build.NoGoError, *build.MultiplePackageError:
// These errors are not fatal, continue.
default:
return nil, err
}
log.Printf("Error scanning %s for packages: %v. Ignoring source files in this directory.", dir, err)
}
if err == nil {
pkgs = append(pkgs, pkg)
Expand Down