awalterschulze / goderive

Derives and generates mundane golang functions that you do not want to maintain yourself
Apache License 2.0
1.23k stars 44 forks source link

defer file.Close #25

Open awalterschulze opened 7 years ago

awalterschulze commented 7 years ago

We open a file and defer to Close it. We typically don't check the Close error, because we are lazy. Is there some way that goderive can make sure we Close even with panics, like defer, and still check the error and return the results from our operation on the file.

This shows some examples https://github.com/mpvl/errd

OladapoAjala commented 2 years ago

@awalterschulze I have decided to start my contribution with this, it should get me started nicely.

I already created a PR let me know your thoughts.

https://github.com/awalterschulze/goderive/pull/78