Defering a function

You decide to defer a function call when coding in Go. What is the benefit of doing this?

1. It guarantees that you will never forget to close the file.

2. The parameters of this function are initialized to zero values by default.

  1. Only 1
  2. Only 2
  3. Both 1 and 2
  4. Neither 1 nor 2

Related Posts

Close Bitnami banner