Merge pull request #291 from silverneko/bpmodify-exit

bpmodify: fix os.Exit() shouldn't shadow panic()
This commit is contained in:
Dan Willemsen 2020-03-05 10:29:27 -08:00 committed by GitHub
commit 215230a3e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,7 +223,12 @@ func walkDir(path string) {
}
func main() {
defer func() { os.Exit(exitCode) }()
defer func() {
if err := recover(); err != nil {
report(fmt.Errorf("error: %s", err))
}
os.Exit(exitCode)
}()
flag.Parse()