The defer statement is used to ensure that a function call is performed _____ in a function.

  • immediately
  • at the end
  • asynchronously
  • conditionally
The "defer" statement in Go is used to ensure that a function call is performed at the end of a function, just before the function returns. It is often used to clean up resources or perform other tasks that should be deferred until the function is about to exit. The "defer" statement is executed in a last-in, first-out (LIFO) order within the function.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *