jasonBirchall / crypto

NO LONGER UPDATED: Cryptocurrency tool for the command line
Apache License 2.0
6 stars 1 forks source link

(CRT-D0011) Calls to `exit`/`fatal` made in function using `defer` #35

Closed jasonBirchall closed 3 years ago

jasonBirchall commented 3 years ago

Description

In these cases, in case of failure, defer never gets called. Example: go defer os.Remove(filename) if bad { log.Fatalf("something bad happened") } should be written as: go defer os.Remove(filename) if bad { log.Printf("something bad happened") return }

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/jasonBirchall/crypto/issue/CRT-D0011/occurrences/