DEV Community

Inanc Gumus
Inanc Gumus

Posted on

5 More Gotchas and Tricks of Defer in Go — Part III

What is inside?

  • Calling recover outside of a deferred func
  • Calling defer in the wrong order
  • Not checking for errors
  • Releasing the same resource twice
  • panic/recover can get and return any type

👉 Press here to read the new article.

See you in two weeks!


Learn Go Programming

👉 I’m tweeting tips and tricks about Go almost daily, follow me on twitter and get them.

Top comments (0)