Skip to content

Commit

Permalink
Use if/else instead of os.Exit(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
samb1729 committed Jun 6, 2016
1 parent f0625b5 commit 6a26cc6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cmd/tomll/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ func main() {
os.Exit(-1)
}
io.WriteString(os.Stdout, s)
os.Exit(0)
}
// otherwise modify a list of files
for _, filename := range flag.Args() {
s, err := lintFile(filename)
if err != nil {
io.WriteString(os.Stderr, err.Error())
os.Exit(-1)
} else {
// otherwise modify a list of files
for _, filename := range flag.Args() {
s, err := lintFile(filename)
if err != nil {
io.WriteString(os.Stderr, err.Error())
os.Exit(-1)
}
ioutil.WriteFile(filename, []byte(s), 0644)
}
ioutil.WriteFile(filename, []byte(s), 0644)
}
}

Expand Down

0 comments on commit 6a26cc6

Please sign in to comment.