Skip to content

Commit

Permalink
cmd/nit: exit AFTER processing all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCarrion committed Dec 31, 2018
1 parent f096b39 commit e33145d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/nit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func main() {
os.Exit(1)
}

var failed bool

for _, pkg := range flag.Args() {
p, err := build.Import(pkg, ".", 0)
if err != nil {
fmt.Printf("error importing %s\n", pkg)
os.Exit(1)
}

var failed bool

for _, f := range p.GoFiles {
fullpath := filepath.Join(p.Dir, f)
v := nit.Nitpicker{LocalPath: *localPkg}
Expand All @@ -57,9 +57,9 @@ func main() {
fmt.Println(err)
}
}
}

if failed {
os.Exit(1)
}
if failed {
os.Exit(1)
}
}

0 comments on commit e33145d

Please sign in to comment.