title: How can Go code plan for exceptions (panic)?
body: <p>I do not know Go. I was going through the docs to get an idea of the language and came up against the Defer Panic Recover functionality.</p>
  
  <p>Panic seems to work like exceptions. However I could not find how my code would guard against these exceptions, which can be thrown by layers deep below the ones I call. Java has checked exceptions. Does Go have something similar? </p>
  
  <p>How does this work? </p>
  
  <p>Edit: There seem to be 2 ways to think about this  </p>
  
  <ol>
  <li>Panic is very rare and it should be allowed to kill the program as described <a href="https://dave.cheney.net/2012/01/18/why-go-gets-exceptions-right" rel="nofollow noreferrer">here</a></li>
  <li>Panic can be used in the regular flow of code - as an example of defer panic as explained <a href="https://blog.golang.org/defer-panic-and-recover" rel="nofollow noreferrer">here</a>, which describes how to use it for malformed input. </li>
  </ol>
  
  <p>My question pertains to usage of panic in situations like 2, which seems to be easily doable. </p>