Closed alexandear closed 9 months ago
This PR fixes a situation when f.Close() is not deferred when dst.Write returns an error. This is because of log.Fatalf internally calls os.Exit. Also, if is inverted to simplify the code.
f.Close()
dst.Write
error
log.Fatalf
os.Exit
if
This PR fixes a situation when
f.Close()
is not deferred whendst.Write
returns anerror
. This is because oflog.Fatalf
internally callsos.Exit
. Also,if
is inverted to simplify the code.