Skip to content

Commit

Permalink
Addressed review feedback from @agnivade
Browse files Browse the repository at this point in the history
  • Loading branch information
jalextowle authored and agnivade committed May 22, 2020
1 parent e841d67 commit ef135b5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ import (
)

func main() {
// NOTE(jalextowle): Since `os.Exit` will cause the process to exit, this defer
// NOTE: Since `os.Exit` will cause the process to exit, this defer
// must be at the bottom of the defer stack to allow all other defer calls to
// be called first. We pass this deferred function a pointer to an exit code
// so that it can be altered later in the program.
// be called first.
exitCode := 0
defer func(code *int) {
os.Exit(*code)
}(&exitCode)
defer func() {
if exitCode != 0 {
os.Exit(exitCode)
}
}()

logger := log.New(os.Stderr, "[wasmbrowsertest]: ", log.LstdFlags|log.Lshortfile)
if len(os.Args) < 2 {
Expand Down

0 comments on commit ef135b5

Please sign in to comment.