Error Handling Strategies In Go

Jerry An
Level Up Coding
Published in
2 min readApr 21, 2022

--

Photo by Possessed Photography on Unsplash

In Go, when a function call returns an error, it’s the caller’s responsibility to check it and take appropriate action. There may be several strategies to handle it.

In this post, let’s take a look at the following four options:

  • Propagate
  • Retry
  • Log and continue.
  • Log and stop the program.

--

--