Skip to content

Commit

Permalink
Skip main packages in lgo installpkg.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunabe committed Mar 20, 2019
1 parent fc7e737 commit 34ba4a2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,18 @@ func (w *walker) walk(path string) bool {
if w.visited[path] {
return true
}
if w.visited == nil {
w.visited = make(map[string]bool)
}
w.visited[path] = true
pkg, err := w.si.getPackage(path)
if err != nil {
w.logf("failed to get package info for %q: %v", path, err)
w.progress++
return false
}
if pkg.Name == "main" {
return true
}
if w.visited == nil {
w.visited = make(map[string]bool)
}
w.visited[path] = true
depok := true
for _, im := range pkg.Imports {
if ok := w.walk(im); !ok {
Expand Down

0 comments on commit 34ba4a2

Please sign in to comment.